Coder Social home page Coder Social logo

monodevelop.cobrabinding's People

Contributors

alexfalkowski avatar charles-esterbrook avatar nefarel avatar ramon-rocha avatar sephthir avatar wilbertom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

monodevelop.cobrabinding's Issues

Cannot find Cobra assembly when running program on Windows

When using the Mono runtime, the Cobra library cannot be found unless the Cobra.Core.dll or Cobra.Lang.dll file is copied into the output folder of the project (i.e. same folder as generated assembly). The program will run successfully when running via .NET. This may be a path/environment variable issue.

Adding a package reference on Windows/.NET results in a compiler crash

On Windows/.NET, adding a reference to a package, as opposed to directly to an assembly such as a .dll, results in the following messages when attempting to compile the project:

error: COBRA INTERNAL ERROR / Win32Exception / The system cannot find the file specified

This is due to the Cobra compiler trying to execute the "pkg-config --lib <package_name>" which is not typically available on Windows.

A more appropriate error message should be displayed or the assemblies contained in the package should be passed to the compiler using the "-ref" option instead of the "-pkg" option. See here: https://github.com/ramon-rocha/MonoDevelop.CobraBinding/blob/master/CobraBinding/CobraLanguageBinding.cobra#L96

Sometimes folders are treated as files

Sometimes, if a project contains folders, they will be passed to the Cobra compiler which result in an error message. They should be excluded from the list of files to compile. Originally it seemed this issue only existed on Windows but it was also recently encountered while working in the 'parser' branch of the addin.

Completion text for generic types should include trailing space

When accepting a generic completion proposal such as List<of a trailing space should be included in the completion text. This way, the developer can immediately start entering the name of the type.

We might want to make this optional based on preference in the future.

Assembly browser shows C# instead of Cobra

Steps:

  1. Create or open a solution in MonoDevelop
  2. Right click "References" in the "Solution" pad and add a reference to System.Data
  3. Expand "References"
  4. Double click System.Data -- this brings up the "Assembly Browser"
  5. Browse some classes

The classes come up in C#. There is a "Language:" pulldown with choices: C#, IL, Summary.

What we want is a "Cobra" choice and for it to be the default for Cobra projects.

Completion proposals are displayed when making declarations

There should be no completion proposals when making a new declaration such as:

def _ or def foo_

This would include any type of declaration such as classes, methods, fields, etc.

Completion proposals should resume after the identifier has been entered.

Without a proper line parser, for now we'll just handle the common cases which should be detailed in https://github.com/ramon-rocha/MonoDevelop.CobraBinding/blob/completion/CobraBinding/manual_tests/completion.txt

Do not enable "Debugging Tips" compiler option

By default, a project in a "Debug" configuration will have the "Debugging Tips" option enabled. This creates confusion when debugging since any exceptions that get thrown will get caught by main. The last line of main will appear to be the source of the exception.

"Debugging Tips" should not be a user option and always set to 'false' behind the scenes.

sig declarations break ensure contract in CobraCompletionTextEditorExtension._createNodeMap

If a class contains a sig declaration, this breaks the ensure contract in _createNodeMap.

ensure
    all for node in regionMap.keys get node in result.values
    all for region in regionMap.values get region in result.keys

The problem appears to be that MethodSig inherits from Class and has some declarations but its child methods resolve to the same DomRegion as their container which is causing some issues with the symbol table.

Do not get autocomplete for newly added method

I added:

    def foo
        pass

to my class above "def main" and then went back to .main and typed: .f

I did not get any completion choices. It says "no matches". I'm expecting "foo".

Environment is MonoDevelop 3.0.5 on Mono 2.10.9 on Mac 10.6.8 on latest 'completion branch' from Sat 2013-02-09 around midday pacific time.

Automatically indent code when appropriate

Completion results are displayed when in a string literal after an escaped quotation mark

s = "hello \" escaped quote"

After entering the preceeding Cobra code in MonoDevelop, the addin will begin to show completion proposals for the letter e because it thinks the string has been terminated.

This will need to be addressed from the 'tooltips' codebase as it includes some new methods for determining if a line of text is an unfinished string: https://github.com/ramon-rocha/MonoDevelop.CobraBinding/blob/tooltips/CobraBinding/TypeSystem/Parser.cobra#L637 It has a bug!

install.cobra fails to compile CobraBinding on Mac

Failed!
$ /Library/Frameworks/Mono.framework/Commands/pkg-config --libs monodevelop
| Package monodevelop was not found in the pkg-config search path.
| Perhaps you should add the directory containing `monodevelop.pc'
| to the PKG_CONFIG_PATH environment variable
| No package 'monodevelop' found
Compilation failed - 1 error, 0 warnings

No clue on this one. I have no Mac to test on.

Strange autocomplete choices for int literals

When I type this statement in a method body (and before hitting Return):

i = 5

I often get an autocompletion menu with choices like:

IDictionary<of TKey,TValue>.extension.396546
...

Environment is MonoDevelop 3.0.5 on Mono 2.10.9 on Mac 10.6.8 on latest 'completion branch' from Sat 2013-02-09 around midday pacific time.

MD won't debug under Win 7

Before I start to document this, let me ask you if you want me to bother with it yet. In short, if I push F5 (or otherwise try to run while debugging), MD3.0x experiences an exception. I would post the incredibly arcane and lengthy error msg for you, but I believe you're already aware of this problem based on your comments over at the Cobra chat.

So let me know if you want me to say more.

Syntax highlighting under MonoDevelop 4.0

On both MonoDevelop 4.0 under Ubuntu, and Xamarin Studio 4.0 under Windows 7, code syntax highlighting appears to be entirely non-functional for the most current version of the addin.

I haven't looked at all into the why, and I don't know if it is a serious issue (given that it is not the most recent version), but it seems worth noting, if for nothing other than future reference as a know issue.

no syntax highlighting

Autocomplete for `String` is wrong

Inside a "def main" I go to type "String." to look at the static methods of the String class. But just before the ".", I'm presented with an autocompletion list with one item "toString". This is incorrect in that without a preceding "." the autocompletion choices should not be methods. The choices should be either blank or a list of accessible types (or local vars or params if I had any, but I don't in this case).

Then when I hit "." after typing "String", the text becomes "toString.".

In summary, typing "String" as the beginning of a statement gives the wrong autocompletion list.

Some keywords are not matched when completion proposals include generics

Example:

"def foo as "

Typing "as " does not match the as keyword and instead wants to match ArraySegment<of T>. Likewise, "ref " does not match the ref keyword and instead wants to match WeakReference<of T>.

I suspect this is because the space is being included in the triggerword. This is a change in behavior from MonoDevelop 3.0.6 introduced with MonoDevelop 4.0.

UnauthorizedAccessException when compiling

I get this error:

error: COBRA INTERNAL ERROR / UnauthorizedAccessException / Access to the path "//MainWrapper.cobra.cs" is denied.

Build: 1 error, 0 warnings

When compiling this code:

class P

    def main
        print 'done.'

Located in this path:

~/Dropbox/Projects/Cobra/workspace-u/Source

But I can compile the above code from the command line with:

$ cobra -c p.cobra
Compilation succeeded

Maybe the working/starting directory of the process that compiles can be set to the directory of the source file (or in the case of a project, the project directory). I think we might need this anyway if the code has "@ref SomeLibrary" where SomeLibrary.dll is in the same directory.

In this case, I don't have a project or solution open. I'm just using MonoDevelop on a single random file.

Do not output exe assembly to bin/Debug folder when working on individual file

Currently, if a single source file is opened without a project, the generated EXE file will be created in a bin/Debug folder in the same location as the source file.

Ideally, the EXE file should be created in the same folder as the source code file without the creation of a bin/Debug folder.

Note, however, that this behavior would not match the default behavior in MonoDevelop for single source files of other languages, such as C#, which also create an EXE in a bin/Debug folder.

Autocomplete should not activate inside doc strings

Given an empty doc string like:

class MyProgram
    """
    """

I open it up (underscore just represents cursor):

class MyProgram
    """
    _
    """

And when I type "String", I get an autocompletion menu. I shouldn't get any autocompletion inside doc strings.

Sometimes it doesn't happen. But if I try several times, it will hit.

Syntax highlighting doesn't work for escaped quotes

All lines following '\'' are treated as a string literal until another single quote character is found.

class Test
    def abc
        if "xyz".contains('\'')
            print "things look good."

This is similar to issue #14 and has the same workaround. Add

# '

to the end of the line containing the escaped quote. Alternatively, wrapping the string in double-quotes when a single quote is required in the string literal (and vice-versa) is another workaround.

        if "xyz".contains("'")

Add support for parameter completion

When we call a method or create a new object, we want to be presented with tooltips that relay information to the developer about the available parameters and overloads.

The data should be displayed automatically when entering the ( character or when hitting Ctrl+Shift+Space and inside a finished or unfinished call (like in the C# binding).

Breakpoints are ignored on Windows

Even running with the Mono runtime as opposed to .NET, I was not able to get the debugger to stop execution at breakpoints. I'm not sure what is causing this.

It is unknown if this is an issue with MonoDevelop, the Cobra addin, the assembly generated by Cobra, or some combination of the three.

Installed addin but can't compile anything

I followed the instructions for Win7 x64, and everything seemed to go ok. I get Cobra as an option when creating a new solution. I'm using MD 3. Syntax highlighting works, and I can create files using the different templates.

But when I try to compile anything (e.g. the example console app) I get the message "Build failed. The system cannot find the file specified". I can see it created a bin/Debug folder but there's nothing in it.

Full output:

Building: TestCobra (Debug|x86)
Performing main compilation...
---------------------- Done ----------------------
Build successful.
Build failed. The system cannot find the file specified


How do I find out what file it's looking for?
I've tried targeting both NET and Mono, I get the same thing.

Console projects re: "Hello World"

minor suggestion -- (at least) in Windows we need a readkey in the default "Hello World' project. from the command line, we obviously don't need it, but using MD we can't get any visible confirmation of "Hello World" without the readkey statement.

""
Replace this text with a description of your program.
"""

class MyProgram

def main
print 'Hello, world!'
Console.readKey

UPDATE
False alarm, but I couldn't find any way in the github software to delete the "issue", other than to edit and remove the contents, leaving this empty issue. If there's a "delete" button around here somewhere, couldn't find it. Could edit. Could close. Couldn't delete.

Completion for NameSpaces from references does not work

This used to be supported but was removed for performance reasons. Eventually we want to add it back in. We want to be able to type:

System

and then hit '.' and get all the sub namespaces under System as completion proposals.

All namespaces from referenced assemblies should be handled the same way.

For now, what does work is adding a use directive for the desired namespace and its declarations will be made available as completion proposals.

Note, the following use directives are implicit for all Cobra code:

use System
use System.Collections.Generic
use System.IO
use System.Text
use Cobra.Core

http://cobra-language.com/trac/cobra/wiki/UseDirective

So, add use Foo.Bar in the interim to the top of your file to make the classes in that namespace available as completion results.

Cannot create new Cobra source file independent of a Cobra project

When attempting to create a new Cobra source file via the File > New menu without an open project, an exception is thrown and the file is not created. This because the fileName is nil at this point and both the Folding parser and TypeSystem parser are expecting a non-nilable fileName.

Opening an existing file outside the context of a solution/project works correctly as does adding a new file to a solution/project.

The workaround at this point is to create the file outside of MonoDevelop and then open it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.