gundermanc / vs-go

Hack and slash Go language service prototype for VS Win + VS Mac
MIT License
8 stars 2 forks source link

Semantic Snapshot #21

Closed gundermanc closed 5 years ago

gundermanc commented 5 years ago

Before making more progress on the parse tree, I’d like to get the basic architecture of the LS into place.

This is an immutable tree of the same structure as the AST, but with type information that can power Quick Info (doc tips), Completion, Symbol Search, etc.

WIP is here: https://github.com/gundermanc/vs-go/tree/topic/semanticSnapshot.

The plan is:

1) Convert existing code that walks the AST over to the visitor pattern. 2) There should be common base classes for visitors that do common operations such as depth-first traversal, binary search, etc. 3) Implement extension methods or services in Go.CodeAnalysis that implements abstract IDE features, like GetFunctions(), GetCollapsibles(), GetQuickInfo(), etc. as operations on the AST and/or Semantic snapshot. 4) Update the WorkspaceDocument to compute the semantic snapshot as part of the reparse and expose it as a property. 5) Update existing editor features to all get the current snapshot and do their operations upon it using the features from step 3. 6) Start implementing features like completion and symbol search on top of the semantic tree. For now, they support basically nothing, but they’ll ‘lightup’ as we add more supported parse cases.

gundermanc commented 5 years ago

@Agunderman10 @benhxy FYI.