Skip to content

[Not completed] CSharp language server

Sergey Skorik edited this page Sep 13, 2018 · 4 revisions

Preconditions:

  1. Create workspace from the .NET stack with .NET project.
  2. Enable C# language server in the Installers tab and start the workspace.

Testing process

  • Language server initialization
  1. From the project open "Program.cs" file.
  2. Check Finished language servers initialization, file path '/dotnet-web-simple/Program.cs' message in the dev-machine console.
  • Code validation feature, Comment line, Autocomplete feature
  1. Open "Program.cs" file.
  2. Make sure that code is validated by LS. We should have info markers in the 1-5 and 8,9 positions. Hover curso for instance on the first maker. Make sure that hint contains Unnecessary using directive.
  3. Remove ; from the Build(); - the error marker should appear. Undo changes the error marker should disappear.
  4. Remove Build till . symbol. Invoke autocomplete (Ctrl+Space). Make sure that Build is present in the widget.
  5. Hover cursor on Build. Make sure that docker window with Builds an Microsoft.AspNetCore.Hosting.IWebHost which hosts a web application. has been opened.
  6. Paste Build and complete Build();
  7. Move cursor in line 1 position and comment this line by Ctrl+/ buttons.
  8. Check that text in line 3 was changed from package main to //package main.
  9. Uncomment this line by Ctrl+/ buttons.
  • Find definition feature
  1. Open "Startup.cs" file.
  2. Add new method in the body of Startup class:
public static String checkMessage(){
            return "Message has been checked";
        }
  1. Add instance of the Startup.cs class into Program.cs in next way: set cursor into the body of Main method of Program.cs and create invocation like: Startup.checkMessage();
  2. Set cursor on the checkMessage and invoke go to the definition by F4 Make sure that Startup.cs file is opened and cursor has been placed to checkMessagemethod.
  3. Set cursor to Build(); and invoke the go to the definition again. Make sure that IWebHostBuilder has been opened and cursor was set to the Build position (Clarify this usecase because this feature may be unavailable)
  • Hover feature
  1. Open "Program.cs" file.
  2. Hover cursor on Build. Make sure that hovering works without duplicated items. In the widget we should get next: IWebHost IWebHostBuilder.Build() Builds an Microsoft.AspNetCore.Hosting.IWebHost which hosts a web application.

Rename TODO

  1. Open "Program.cs" file.
  2. Select "" variable in line ****.
  3. Start Rename feature by Shift+F6 or from Assistant menu.
  4. Type new variable name.
  5. Check that the variable name was changed.

Signature Help TODO

  1. Open "Program.cs" file.
  2. Type `````` on line .
  3. Type '(' symbol and wait for hover popup with `````` text.
  4. Delete added line.

Go To Symbol TODO

  1. Open "Program.cs" file.
  2. Start Go To Symbol feature by Ctrl+F12 buttons or from Assistant menu.
  3. Wait for Go To Symbol form is opened with next lines:

  1. Click on any of them and check that it correctly selected in file.