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

Benefit over existing code outline extensions? #1

Closed
st-schneider opened this issue Oct 12, 2017 · 2 comments
Closed

Benefit over existing code outline extensions? #1

st-schneider opened this issue Oct 12, 2017 · 2 comments

Comments

@st-schneider
Copy link

I was just asking myself, what benefits have your implementation over the already existing ones like?

https://github.com/patrys/vscode-code-outline

@oleg-shilo
Copy link
Owner

oleg-shilo commented Oct 12, 2017

I haven't tested that extension. The extension home page does not contain any screenshot so I didn't identify it as belonging to the same category.

Anyway I just tested it now and indeed it is a good extension that brings very similar functionality as Code Map. Right now I can pick only a two differences:

  • vscode-code-outline uses nested tree view for presentation and CodeMap a flat tree view with indentation to indicate the nesting level. I have implemented both flat and nested approach but since VSCode still has the problem with uncontrollable TreeViewNode state change on clicking I opted to the more predictable flat tree view. But when VSCode team addresses the problem (TreeDataProvider: allow selecting a TreeItem without affecting its collapsibleState microsoft/vscode#34130) I will enable the true nesting and add node icons.

  • vscode-code-outline has a more comprehensive parsing algorithm. CodeMap has adequate but very simplistic TS parsing algorithm implemented at this stage.

However the major distinction point is that CodeMap is a port of the Sublime CodeMap plugin, which is rather a code mapping infrastructure then a one off specific syntax product.

Thus CodeMap comes with:

  • A few built-in dedicated mappers (syntax specific algorithms): TS, Python, C#.
  • An universal RegEx-based mapper that can be configured (settings file) to handle new languages
  • Users can implement (with TS) their own dedicated mappers (e.g. for ini file syntax) and extend CodeMap with new syntax support.

In a few days I will be releasing Python mapper. Then it will be turn for Roslyn-based C# mapper, and after that custom mappers and eventually the universal mapper support.

Thus if you are only interested in TypeScript then probably you can stick with vscode-code-outline. Otherwise, keep an eye on CodeMap.

@st-schneider
Copy link
Author

Thanks for the elaborate answer. This was very informative.

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

No branches or pull requests

2 participants