Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for different omnisharp "engines" #3817

Merged
merged 30 commits into from
Jun 13, 2023

Conversation

david-driscoll
Copy link
Contributor

@david-driscoll david-driscoll commented May 31, 2020

Adds support for different OmniSharp "engines" and moves to using 0-based indices.

@JoeRobich I'm mainly looking to test the waters on your end if this is something you would be okay with. At the end of the day I think we only need one engine, but the idea here is that we would have a nice way to fallback to the old one in the event there were problems.

The goal here is to move the extension forward a little bit:

  • Today the entire buffer is sent each request and updated on the server side
    • This is pretty inefficient and with big documents causes some problems.
  • Today diagnostics / codecheck is done as a client pull instead of server push

This replaces the custom omnisharp protocol with the vscode language client. However all of the features of the language client are disabled, this means that requests are processed the same as they always have been (with full buffers).

Consider this phase 1, the goal of phase 2 could be to move away from sending the buffer every time and instead using the text document events built into lsp. Phase 3 might involve removing some handlers for operations that don't have special behaviors (metadata, tests, etc).

Things that need to be done:

  • Test with mono / linux / mac
  • Get the latest lsp shipped into omnisharp-roslyn

This depends on OmniSharp/omnisharp-roslyn#1815 which adds the support for calling exising omnisharp endpoints via LSP.

@JoeRobich
Copy link
Member

I think this is a step in the right direction. Would definitely want to make sure changing the indexing doesn't break the Razor or Debugger extensions.

@NTaylorMullen @gregg-miskelly

Copy link
Contributor

@NTaylorMullen NTaylorMullen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really cool idea! Ya the indexing is definitely concerning. However; given we rely on LSP contracts I'd imagine wherever we depend on you would just work because you also need to respect those contracts in order for VSCode to "ok" your data.

@david-driscoll
Copy link
Contributor Author

So the reason for the change of indexing is to follow the lsp spec (0 based vs 1 based). The only reason omnisharp had been ones based originally was due to the legacy how emacs/vim did line numbers internally.

NOTE: Omnisharp does 0-based indexes today, and the configuration setting just turns on a jsonconverter that transforms the 0-based indexes to 1-based. So today we're translating twice (0 -> 1, 1 -> 0) 😄

I'll take a look and see if there are things that need to be done in razor plugin, but

@david-driscoll david-driscoll marked this pull request as ready for review July 27, 2020 05:17
@codecov
Copy link

codecov bot commented Jul 27, 2020

Codecov Report

Merging #3817 (0741c53) into master (2882168) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3817      +/-   ##
==========================================
+ Coverage   85.99%   86.01%   +0.01%     
==========================================
  Files          60       60              
  Lines        1878     1880       +2     
  Branches      218      218              
==========================================
+ Hits         1615     1617       +2     
  Misses        202      202              
  Partials       61       61              
Flag Coverage Δ
integration 100.00% <ø> (ø)
unit 86.01% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/omnisharp/options.ts 94.79% <100.00%> (+0.11%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 47d640b...f5e3025. Read the comment docs.

@david-driscoll david-driscoll force-pushed the feature/lsp-engine branch 4 times, most recently from 1875bdc to 7fe64e9 Compare August 22, 2020 05:32
Copy link
Member

@JoeRobich JoeRobich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very excited for this work to get in.

@david-driscoll
Copy link
Contributor Author

updated to actually run on Mac and hopefully linux @333fred let me know

@JoeRobich
Copy link
Member

I have brought the changes from this PR up to date and pushed it as branch feature/lsp-engine. We can continue to evolve these changes from the feature branch.

@dibarbet dibarbet merged commit 9ddcea8 into dotnet:main Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants