-
Notifications
You must be signed in to change notification settings - Fork 16
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
Switch CodeMirror to get completions via the language server #66
Conversation
@dqnykamp This should be ready to merge :-) |
@@ -166,6 +166,25 @@ describe("AutoCompleter", () => { | |||
`); | |||
} | |||
}); | |||
it("Can suggest completions after a `<`", () => { |
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.
This tests makes me think that after typing "<" in the editor, I should get some completions. However I don't get completions after typing just "<" inside a <codeEditor>
tag (in test-viewer dev server) or inside the editor from the dev server in lsp-tools.
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.
Really? I need to look into that then...It gives suggestions to me when testing out in packages/codemirror
.
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.
Tried it out more. It turns out it doesn't work if my cursor is at the end of the file, but it works otherwise. I was always testing at the end of the file, so it wasn't working.
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.
When at the end of the file, typing <
does now start the autocomplete. But, if subsequently type a
, then the autocomplete closes.
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.
Also, if at end of file and have an unclosed open tag, then <
does not suggest the closing tag.
Autocomplete should now work for opening tags at the end of a string. Closing tags are still an issue. I added a |
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.
Remaining autocomplete issues for closing tags are given in issue #71.
This PR adds language server support to codemirror for autocompletion. This will allow completion of macros in the future. It also uses
react-codemirror
to manage the codemirror interface rather than manually managing it through references.