-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
vscode: add syntax tree inspection hovers and highlights #3787
Conversation
a181e28
to
065545e
Compare
class TextDocumentContentProvider implements vscode.TextDocumentContentProvider, Disposable { | ||
readonly uri = vscode.Uri.parse('rust-analyzer://syntaxtree'); | ||
readonly eventEmitter = new vscode.EventEmitter<vscode.Uri>(); | ||
private readonly disposables: Disposable[] = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tdcp is a singleton, so we can just re-use ctx.subscriptions
without implementing our our disposing logic.
065545e
to
09a760e
Compare
border: "#ffffff 1px solid", | ||
}); | ||
private rustEditor: undefined | RustEditor; | ||
private readonly disposables: Disposable[] = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, there's only ever one of these, so it doesn't need its own disposable array.
@matklad |
We can use existing thing, I see no reason not to use it.
|
Migrated to the existing thing, added docs. |
Added |
bors r+ |
Build succeeded |
This doesn't play nice with light themes 😅. I was wondering why I don't see the border. |
ggwp |
I implemented the reverse mapping (when you hover in the rust editor), but it seems overcomplicated, so I removed it
Related #3682