-
Notifications
You must be signed in to change notification settings - Fork 71
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
Fix #1332 - Add autoinsert support #1333
Fix #1332 - Add autoinsert support #1333
Conversation
CompletableFuture.supplyAsync(() -> { | ||
try { | ||
// Wait for textDocument/didChange | ||
Thread.sleep(100); |
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 code that I de for XML is so bad and can give some blocking thread bugs.
@mickaelistria LSP4e should provide an API to execute somerhing after à didChange
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.
I off course agree, for now this is copy-paste from HTMLAutoInsertReconciler
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.
I made some tests and prepared pull request for lsp4e: eclipse-lsp4e/lsp4e#812
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.
I don't know much about vue; but it looks OK to me (I've just put 1 comment about code but it's not important).
So I think it's OK to merge it if build succeeds.
// we receive a text like | ||
// $0</foo> | ||
// $0 should be used for set the cursor. | ||
String newText = response.map(l -> l, r -> r.getNewText()); |
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.
Can be
String newText = response.map(l -> l, r -> r.getNewText()); | |
String newText = response.map(Function.identity(), r::getNewText); |
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.
Done, as I wrote in description this patch is much bigger than AutoInsert. Take a look to VuePreferences, and how it work with vscode-vue package.json. It's completely different to HTMLPreferenceServerConstants and similar
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.
Done, as I wrote in description this patch is much bigger than AutoInsert.
Do you think it's worth reworking this patch in a series of easier to understand yet functionally valuable patches to facilitate further maintenance?
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.
Sure, one moment
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.
I published autoinsert-only part (works on default settings). For example auto close html tags <tag>|</tag>
, and transform {{|}}
to {{ | }}
in templates. No new rows in package.json
OK, feel free to merge this one as soon as you're ready for it ;) |
Sure, when I will gain privileges :D |
OK, I see the nomination process pretty advanced but not complete yet (requires EMO or PMC to give a final approval I guess). Do you prefer I merge it now, or you merge it later? |
Please merge as-is. THX |
bd4d902
into
eclipse-wildwebdeveloper:master
I started from AutoInsert reconciler, but as the result , there is a quiet big path:
In general, preference support is nighmare. If server can consume extra preferences, each section server have to be mapped manually. I think this should be somehow pluggable, probably on LSP4E level