Skip to content

added the workspace symbol provider for markdown #46406#47610

Merged
mjbvz merged 2 commits into
microsoft:masterfrom
pradeepmurugesan:markdown-workspace-symbol-provider
Apr 13, 2018
Merged

added the workspace symbol provider for markdown #46406#47610
mjbvz merged 2 commits into
microsoft:masterfrom
pradeepmurugesan:markdown-workspace-symbol-provider

Conversation

@pradeepmurugesan

@pradeepmurugesan pradeepmurugesan commented Apr 10, 2018

Copy link
Copy Markdown
Contributor

@mjbvz mjbvz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for looking into this! Just a few changes before we can merge this in. Let me know if you have any questions about my comments


public constructor(symbolProvider: MDDocumentSymbolProvider) {
this.symbolProvider = symbolProvider;
this.populateSymbolCache();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should be done lazily when workspace symbols are first requested

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done..

}

private registerOnSaveEvent(): void {
workspace.onDidSaveTextDocument(async document => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This registration returns a registration handle that handles unregistering the event handler. Add a dispose method on MarkdownWorkspaceSymbolProvider and then call .dipose() on the the registration handle to make sure it is properly cleaned up

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@mjbvz I have one question here. I have made the changes though.. Excuse me if my question is naive..

Who calls the dispose method? I couldn't find the same in the WorkspaceSymbolProvider interface as well.. I assume there should be a common place to check if the method "dispose" exists on an object and then invoke this.

Can you kindly point me to that.

@mjbvz mjbvz self-assigned this Apr 10, 2018

@nzec nzec left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Awesome!

@pradeepmurugesan

Copy link
Copy Markdown
Contributor Author

@mjbvz got a chance to look into the changes.. ?

@mjbvz mjbvz added this to the April 2018 milestone Apr 13, 2018
@mjbvz mjbvz merged commit 5e993f7 into microsoft:master Apr 13, 2018
@mjbvz

mjbvz commented Apr 13, 2018

Copy link
Copy Markdown
Contributor

Thanks! Will be in the next insiders build and in VS Code 1.23

@pradeepmurugesan

Copy link
Copy Markdown
Contributor Author

@mjbvz Thanks for merging.. I had asked a question in the review comment. It will be really helpful if you could answer the same.

Who calls the dispose method? I couldn't find the same in the WorkspaceSymbolProvider interface as well.. I assume there should be a common place to check if the method "dispose" exists on an object and then invoke this.

Can you kindly point me to that.

@mjbvz

mjbvz commented Apr 17, 2018

Copy link
Copy Markdown
Contributor

In this case it will never get called. The extension would have to register the provider as one of its disposables but this is pointless because the extension itself never gets disposed. It's still good practice to clean up any resources in a dispose method though, which does come in handy today when writing tests

@mjbvz

mjbvz commented Apr 17, 2018

Copy link
Copy Markdown
Contributor

@pradeepmurugesan By the way, do you have a twitter handle that you would like mentioned when we call out this feature? Tweeting can help get some additional testing on the feature and I want to make sure proper credit is given for your work

@pradeepmurugesan

Copy link
Copy Markdown
Contributor Author

@mjbvz Sure.. This is my twitter profile https://twitter.com/pradeepm_14. Handle- @pradeepm_14

@github-actions github-actions Bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants