Skip to content

Conversation

@NikolasKomonen
Copy link
Collaborator

No description provided.

@NikolasKomonen NikolasKomonen force-pushed the disableAutoCloseBrackets branch from a04213f to 57581be Compare October 16, 2018 16:25
src/extension.ts Outdated
function getSettings(): JSON {
let configXML = workspace.getConfiguration();

let autoCloseTags = configXML.get("xml.completion.autoCloseTags");
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should only happen on configuration change on the client side.
there's no need to send that config to the server

src/extension.ts Outdated

let autoCloseTags = configXML.get("xml.completion.autoCloseTags");
let autoClosingBrackets = configXML.get("[xml]")["editor.autoClosingBrackets"];
if (autoCloseTags && autoClosingBrackets != "never") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

you need to ask permission for changing the value. Not do it 1st and ask for forgiveness

@NikolasKomonen NikolasKomonen force-pushed the disableAutoCloseBrackets branch 2 times, most recently from b392503 to 6486e19 Compare October 16, 2018 19:14
src/extension.ts Outdated
(error) => console.log(error)
);
}
else {
Copy link
Collaborator

Choose a reason for hiding this comment

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

be careful, this is the case when user presses escape. You don't want to do anything if action gets cancelled on purpose

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good catch, ill fix

@NikolasKomonen NikolasKomonen force-pushed the disableAutoCloseBrackets branch from 6486e19 to da64432 Compare October 16, 2018 20:48
src/extension.ts Outdated
let autoCloseTags = configXML.get("xml.completion.autoCloseTags");
let autoClosingBrackets = configXML.get("[xml]")["editor.autoClosingBrackets"];
if (autoCloseTags && autoClosingBrackets != "never") {
window.showInformationMessage(
Copy link
Collaborator

Choose a reason for hiding this comment

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

showWarningMessage

@NikolasKomonen NikolasKomonen force-pushed the disableAutoCloseBrackets branch from da64432 to fa23a10 Compare October 16, 2018 20:50
@NikolasKomonen NikolasKomonen force-pushed the disableAutoCloseBrackets branch 2 times, most recently from 6e221ab to ba94c4f Compare October 17, 2018 19:25
@NikolasKomonen
Copy link
Collaborator Author

@fbricon Updated, I didnt add the preference for the warning though. It will just remember for the servers lifecycle and not ask again.

@NikolasKomonen NikolasKomonen force-pushed the disableAutoCloseBrackets branch from ba94c4f to 4e699ff Compare October 18, 2018 19:00
src/extension.ts Outdated
let configXML = workspace.getConfiguration();
let autoCloseTags = configXML.get("xml.completion.autoCloseTags");
let autoClosingBrackets = configXML.get("[xml]");
console.log(autoClosingBrackets);
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove log

src/extension.ts Outdated
let autoCloseTags = configXML.get("xml.completion.autoCloseTags");
let autoClosingBrackets = configXML.get("[xml]");
console.log(autoClosingBrackets);
autoClosingBrackets = autoClosingBrackets["editor.autoClosingBrackets"];
Copy link
Collaborator

Choose a reason for hiding this comment

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

please use a different variable name. this is too confusing

@fbricon
Copy link
Collaborator

fbricon commented Oct 19, 2018

Few minor changes left to do but it looks pretty good now.

Fixes redhat-developer#38

Signed-off-by: Nikolas Komonen <nikolaskomonen@gmail.com>
@NikolasKomonen NikolasKomonen force-pushed the disableAutoCloseBrackets branch from 4e699ff to 40859e1 Compare October 19, 2018 13:49
@NikolasKomonen
Copy link
Collaborator Author

@fbricon Updated

@fbricon fbricon merged commit c1d7ac9 into redhat-developer:master Oct 19, 2018
@fbricon fbricon added the enhancement New feature or request label Oct 19, 2018
@fbricon fbricon added this to the 0.2.0 milestone Oct 19, 2018
@NikolasKomonen NikolasKomonen deleted the disableAutoCloseBrackets branch January 23, 2019 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants