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

Implement support for the Language Server Protocol #686

Closed
15 tasks done
falko17 opened this issue Dec 23, 2023 · 0 comments · Fixed by #751
Closed
15 tasks done

Implement support for the Language Server Protocol #686

falko17 opened this issue Dec 23, 2023 · 0 comments · Fixed by #751
Assignees
Labels
enhancement New feature or request

Comments

@falko17
Copy link
Collaborator

falko17 commented Dec 23, 2023

As part of my master's thesis, I will add support for a subset of the features of the Language Server Protocol (namely, all relevant features that are not about editing code).
Afterward, a GXL will not necessarily be required to generate code cities if a Language Server is available, and the code viewer will have more IDE-like features.

Steps

  1. Preparations:
    • CodeWindow code should be cleaned up, as they will be worked on quite a bit later.
      • All multiplayer code should be removed, e.g., CRDTs. It makes the CodeWindows too complex to reliably maintain otherwise.
      • Unless the code can be reworked to be actually maintainable and the performance issues can be fixed, editing features should be removed too.
    • Support for OmniSharp's C# LSP client should be added.
      • It might make sense to add NuGetForUnity for this purpose.
    • LSP: Preparations and Cleanup #687
  2. Load cities using LSP:
  3. Add LSP features to code windows:
  4. Add LSP features to code cities:
@falko17 falko17 added the enhancement New feature or request label Dec 23, 2023
@falko17 falko17 self-assigned this Dec 23, 2023
falko17 added a commit that referenced this issue Dec 23, 2023
This also pulled in quite a bit of other dependencies, including
Microsoft's C# Language Analyzer. Hence, some additional warnings
and diagnostics appeared.
falko17 added a commit that referenced this issue Dec 23, 2023
This also pulled in quite a bit of other dependencies, including
Microsoft's C# Language Analyzer. Hence, some additional warnings
and diagnostics appeared.
falko17 added a commit that referenced this issue Mar 3, 2024
This adds an LSPGraphProvider which can create a graph using
LSP-provided information. For this purpose, an LSPHandler has been added
whose primary purpose is to manage the communication between SEE and
language servers. Additionally, LSPServer and LSPLanguage records have
been added using the "enhanced enum" pattern. These contains as static
attributes all language servers and programming languages supported by
SEE, respectively. Currently, just the rust-analyzer and pyright have
been added, of which only the first works to retrieve hierarchic symbols
from software projects.

Also, a TeeStream class has been handled, which is a stream that works
similar to the Unix `tee` command (or, visually, like a T-pipe)—that is,
it redirects anything read and written through it is (in addition to its
primary stream) piped to a secondary stream. The specific reason this
class has been added is so that I can view the input and output of LSP
processes for debugging purposes.
falko17 added a commit that referenced this issue Apr 26, 2024
This adds an LSPGraphProvider which can create a graph using
LSP-provided information. For this purpose, an LSPHandler has been added
whose primary purpose is to manage the communication between SEE and
language servers. Additionally, LSPServer and LSPLanguage records have
been added using the "enhanced enum" pattern. These contains as static
attributes all language servers and programming languages supported by
SEE, respectively. Currently, just the rust-analyzer and pyright have
been added, of which only the first works to retrieve hierarchic symbols
from software projects.

Also, a TeeStream class has been handled, which is a stream that works
similar to the Unix `tee` command (or, visually, like a T-pipe)—that is,
it redirects anything read and written through it is (in addition to its
primary stream) piped to a secondary stream. The specific reason this
class has been added is so that I can view the input and output of LSP
processes for debugging purposes.
falko17 added a commit that referenced this issue Apr 26, 2024
This implements an algorithm in LSPImporter that
creates the graph for a code city based on information retrieved using
the Language Server Protocol. The details of how this works are out of
scope for this commit message, but the code is documented, and the
general approach will be described in detail in my master's thesis.

Note that there are still some TODOs and FIXMEs that need to be
addressed before this is ready for production use. Most notably, the
call hierarchy is not retrieved (and hence no "Call" edges are being
created), as there seems to be a bug in the OmniSharp library that I
have not been able to fix yet.
Additionally, I still need to test various LSP servers—right now, only
pyright, Omnisharp, dart-lsp, and rust-analyzer have been tested.
falko17 added a commit that referenced this issue Apr 26, 2024
This adds an LSPGraphProvider which can create a graph using
LSP-provided information. For this purpose, an LSPHandler has been added
whose primary purpose is to manage the communication between SEE and
language servers. Additionally, LSPServer and LSPLanguage records have
been added using the "enhanced enum" pattern. These contains as static
attributes all language servers and programming languages supported by
SEE, respectively. Currently, just the rust-analyzer and pyright have
been added, of which only the first works to retrieve hierarchic symbols
from software projects.

Also, a TeeStream class has been handled, which is a stream that works
similar to the Unix `tee` command (or, visually, like a T-pipe)—that is,
it redirects anything read and written through it is (in addition to its
primary stream) piped to a secondary stream. The specific reason this
class has been added is so that I can view the input and output of LSP
processes for debugging purposes.
falko17 added a commit that referenced this issue Apr 26, 2024


This tree will be used to match LSP ranges to the most fitting nodes
as part of the LSP graph creation process.
falko17 added a commit that referenced this issue Apr 26, 2024
This implements an algorithm in LSPImporter that
creates the graph for a code city based on information retrieved using
the Language Server Protocol. The details of how this works are out of
scope for this commit message, but the code is documented, and the
general approach will be described in detail in my master's thesis.

Note that there are still some TODOs and FIXMEs that need to be
addressed before this is ready for production use. Most notably, the
call hierarchy is not retrieved (and hence no "Call" edges are being
created), as there seems to be a bug in the OmniSharp library that I
have not been able to fix yet.
Additionally, I still need to test various LSP servers—right now, only
pyright, Omnisharp, dart-lsp, and rust-analyzer have been tested.
falko17 added a commit that referenced this issue Apr 30, 2024
This adds support for the following languages to SEE:
* C
* C++
* C#
* Dart
* Go
* Haskell
* Java
* JavaScript
* Kotlin
* LaTeX
* Lua
* MATLAB
* PHP
* Python
* Ruby
* Rust
* TypeScript
* Zig

Additionally, the following miscellaneous languages are supported:
* JSON
* LaTeX
* Markdown
* XML

All languages above (along with all added LSP servers)
have been tested first with some sample project,
to make sure it is actually viable to produce
code cities for them via this method.
falko17 added a commit that referenced this issue Apr 30, 2024
This adds an LSPGraphProvider which can create a graph using
LSP-provided information. For this purpose, an LSPHandler has been added
whose primary purpose is to manage the communication between SEE and
language servers. Additionally, LSPServer and LSPLanguage records have
been added using the "enhanced enum" pattern. These contains as static
attributes all language servers and programming languages supported by
SEE, respectively. Currently, just the rust-analyzer and pyright have
been added, of which only the first works to retrieve hierarchic symbols
from software projects.

Also, a TeeStream class has been handled, which is a stream that works
similar to the Unix `tee` command (or, visually, like a T-pipe)—that is,
it redirects anything read and written through it is (in addition to its
primary stream) piped to a secondary stream. The specific reason this
class has been added is so that I can view the input and output of LSP
processes for debugging purposes.
falko17 added a commit that referenced this issue Apr 30, 2024


This tree will be used to match LSP ranges to the most fitting nodes
as part of the LSP graph creation process.
falko17 added a commit that referenced this issue Apr 30, 2024
This implements an algorithm in LSPImporter that
creates the graph for a code city based on information retrieved using
the Language Server Protocol. The details of how this works are out of
scope for this commit message, but the code is documented, and the
general approach will be described in detail in my master's thesis.

Note that there are still some TODOs and FIXMEs that need to be
addressed before this is ready for production use. Most notably, the
call hierarchy is not retrieved (and hence no "Call" edges are being
created), as there seems to be a bug in the OmniSharp library that I
have not been able to fix yet.
Additionally, I still need to test various LSP servers—right now, only
pyright, Omnisharp, dart-lsp, and rust-analyzer have been tested.
falko17 added a commit that referenced this issue Jun 16, 2024
This includes LSP errors, LSP warnings, LSP info messages, and LSP hints
falko17 added a commit that referenced this issue Jun 29, 2024
This also heavily refactors our existing scanner
infrastructure to accomodate both Antlr based lexers
and LSP-based semantic token providers.
As the latter also support supplying token modifiers,
support for this has been added as well
(e.g., rendering static things in italics).
falko17 added a commit that referenced this issue Jul 4, 2024
This also heavily refactors our existing scanner
infrastructure to accomodate both Antlr based lexers
and LSP-based semantic token providers.
As the latter also support supplying token modifiers,
support for this has been added as well
(e.g., rendering static things in italics).
falko17 added a commit that referenced this issue Jul 17, 2024
This also heavily refactors our existing scanner
infrastructure to accomodate both Antlr based lexers
and LSP-based semantic token providers.
As the latter also support supplying token modifiers,
support for this has been added as well
(e.g., rendering static things in italics).
falko17 added a commit that referenced this issue Jul 24, 2024
This can be triggered by right-clicking any element
in the code window.
falko17 added a commit that referenced this issue Jul 26, 2024
falko17 added a commit that referenced this issue Jul 27, 2024
This also heavily refactors our existing scanner
infrastructure to accomodate both Antlr based lexers
and LSP-based semantic token providers.
As the latter also support supplying token modifiers,
support for this has been added as well
(e.g., rendering static things in italics).
falko17 added a commit that referenced this issue Jul 27, 2024
This can be triggered by right-clicking any element
in the code window.
falko17 added a commit that referenced this issue Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant