CShell icon indicating copy to clipboard operation
CShell copied to clipboard

Autocompletion does not work very well when creating a class in a script

Open RedwoodForest opened this issue 10 years ago • 2 comments

It seems like the autocompletion doesn't currently work very well when defining new classes/methods/etc. right now, and because of that often completes something unexpected.

If I open a new script file and type public static[spacebar] in it the static gets autocompleted to ContextStaticAttribute. This is unfortunate because I do actually want to static because I'm creating a class but it doesn't seem to even consider static as a possible completion.

RedwoodForest avatar May 18 '14 19:05 RedwoodForest

Yep, this is a bit of a problem. So far CShell has not supported mixing class definitions and script code in one file. This is because the underlying mono engine did not really support it.

For example you can't execute all this at once:

 class A
 {
   public int My;
 }
 var a = new A();
 a.My = 10;

You'd have to evaluate first the class definition, and then the last two lines.

However, I'm working on switching over to using the Roslyn engine and this will work soon. So I agree, the code completion should support this as well.

lukebuehler avatar May 19 '14 13:05 lukebuehler

Bumped this conversation over at the NRefactory project. A lot of exciting changes coming to code completion from NRefactory.

lukebuehler avatar May 21 '14 15:05 lukebuehler