Skip to content
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

autoClosingBrackets are forced off if autoCloseTags is enabled #62

Merged

Conversation

NikolasKomonen
Copy link
Contributor

No description provided.

src/extension.ts Outdated
@@ -75,6 +75,17 @@ export function activate(context: ExtensionContext) {

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
Contributor 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

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 2 times, most recently from 6e221ab to ba94c4f Compare October 17, 2018 19:25
@NikolasKomonen
Copy link
Contributor Author

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

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

package.json Show resolved Hide resolved
@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
Copy link
Contributor 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.

None yet

2 participants