Skip to content

Commit 58a520f

Browse files
committed
chore: format
1 parent e65484e commit 58a520f

File tree

7 files changed

+64
-66
lines changed

7 files changed

+64
-66
lines changed

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ changelog.md
66
coverage
77
build
88
dist
9-
lib

CONTRIBUTING.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Contributing
22

33
Everyone is welcome to contribute, in whatever form they are comfortable with. For example:
4+
45
- improve documentation,
56
- test features,
67
- fix bugs,
@@ -38,7 +39,7 @@ For general information regarding debugging in Atom, take a look at [debugging][
3839

3940
### Language Server Protocol (LSP)
4041

41-
Atom IDE packages revolve around [language server protocol], for which integration base is provided by [atom-languageclient].
42+
Atom IDE packages revolve around [language server protocol], for which integration base is provided by [atom-languageclient].
4243

4344
To log communication between Atom and a language server, dedicated debugging option needs to be set in Atom's configuration, `atom.config.set('core.debugLSP', true)` - e.g. through [init file]. Log entries should be visible in the console, in Developer Tools (`ctrl+shift+i`), e.g.:
4445

@@ -47,12 +48,13 @@ TypeScript (Theia) [Started] Starting Theia for some-project
4748
rpc.sendRequest textDocument/definition sending {textDocument: {…}, position: {…}}
4849
rpc.sendRequest textDocument/definition received (27ms) [{…}]
4950
```
50-
*Note: "Verbose" log level is required for some entries*
51+
52+
_Note: "Verbose" log level is required for some entries_
5153

5254
[semantic-release]: https://github.com/semantic-release/semantic-release
5355
[conventional commits]: https://www.conventionalcommits.org/en/v1.0.0
5456
[commitlint]: https://commitlint.js.org
55-
[Husky]: https://github.com/typicode/husky
57+
[husky]: https://github.com/typicode/husky
5658
[atom-debugging]: https://flight-manual.atom.io/hacking-atom/sections/debugging/
5759
[atom-languageclient]: https://github.com/atom/atom-languageclient
5860
[language server protocol]: https://microsoft.github.io/language-server-protocol/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Vue language support for [Atom IDE][]
88

99
1. Install `atom-ide-vue` from Atom's packages repository
1010

11-
Note: Since Atom comes with [autocomplete+](https://atom.io/packages/autocomplete-plus) package preinstalled, basic suggestions should be available immediately.
11+
Note: Since Atom comes with [autocomplete+](https://atom.io/packages/autocomplete-plus) package preinstalled, basic suggestions should be available immediately.
1212

1313
2. Install [language-vue](https://atom.io/packages/language-vue)
1414

lib/config.js

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,39 @@
1-
const extensionConfig = atom.config.get("atom-ide-vue");
1+
const extensionConfig = atom.config.get("atom-ide-vue")
22

33
const initializationOptions = {
44
config: {
55
vetur: {
66
validation: {
77
template: extensionConfig.validation.template,
88
style: extensionConfig.validation.style,
9-
script: extensionConfig.validation.script
9+
script: extensionConfig.validation.script,
1010
},
1111
completion: {},
1212
format: {
1313
defaultFormatterOptions: {},
14-
options: {}
14+
options: {},
1515
},
1616
dev: {},
1717
trace: {},
1818
experimental: {
19-
templateInterpolationService:
20-
extensionConfig.experimental.templateInterpolationService
21-
}
19+
templateInterpolationService: extensionConfig.experimental.templateInterpolationService,
20+
},
2221
},
2322
css: {},
2423
html: {
25-
suggest: {}
24+
suggest: {},
2625
},
2726
javascript: {
28-
format: {}
27+
format: {},
2928
},
3029
typescript: {
31-
format: {}
30+
format: {},
3231
},
3332
emmet: {},
34-
stylusSupremacy: {}
35-
}
36-
};
33+
stylusSupremacy: {},
34+
},
35+
}
3736

3837
module.exports = {
39-
initializationOptions
40-
};
38+
initializationOptions,
39+
}

lib/grammar.js

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,37 @@
11
function updateOpenEditors(oldGrammar, newGrammar) {
2-
const openEditors = atom.workspace.getTextEditors();
3-
openEditors.forEach(editor => {
4-
const editorGrammar = editor.getGrammar();
2+
const openEditors = atom.workspace.getTextEditors()
3+
openEditors.forEach((editor) => {
4+
const editorGrammar = editor.getGrammar()
55

6-
const hasOldGrammar = editorGrammar.name === oldGrammar.name;
6+
const hasOldGrammar = editorGrammar.name === oldGrammar.name
77
if (hasOldGrammar) {
8-
editor.setGrammar(newGrammar);
8+
editor.setGrammar(newGrammar)
99
}
10-
});
10+
})
1111
}
1212

1313
function renameGrammarForScopeName(scopeName, newName) {
14-
const currentGrammar = atom.grammars.grammarForScopeName(scopeName);
14+
const currentGrammar = atom.grammars.grammarForScopeName(scopeName)
1515

1616
if (currentGrammar) {
1717
atom.grammars.readGrammar(currentGrammar.path, (error, grammarRenamed) => {
1818
if (error) {
19-
console.error("Failed to read grammar to rename", error);
20-
return;
19+
console.error("Failed to read grammar to rename", error)
20+
return
2121
}
2222

23-
grammarRenamed.name = newName;
23+
grammarRenamed.name = newName
2424

25-
atom.grammars.removeGrammarForScopeName(scopeName);
26-
atom.grammars.addGrammar(grammarRenamed);
25+
atom.grammars.removeGrammarForScopeName(scopeName)
26+
atom.grammars.addGrammar(grammarRenamed)
2727

28-
updateOpenEditors(currentGrammar, grammarRenamed);
28+
updateOpenEditors(currentGrammar, grammarRenamed)
2929

30-
console.log(
31-
`Grammar for scope ${scopeName} renamed from "${currentGrammar.name}" to "${grammarRenamed.name}"`
32-
);
33-
});
30+
console.log(`Grammar for scope ${scopeName} renamed from "${currentGrammar.name}" to "${grammarRenamed.name}"`)
31+
})
3432
}
3533
}
3634

3735
module.exports = {
38-
renameGrammarForScopeName
39-
};
36+
renameGrammarForScopeName,
37+
}

lib/main.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
const path = require("path");
2-
const { AutoLanguageClient } = require("atom-languageclient");
3-
const { initializationOptions } = require("./config");
4-
const { renameGrammarForScopeName } = require("./grammar");
1+
const path = require("path")
2+
const { AutoLanguageClient } = require("atom-languageclient")
3+
const { initializationOptions } = require("./config")
4+
const { renameGrammarForScopeName } = require("./grammar")
55

66
class VueLanguageClient extends AutoLanguageClient {
77
getGrammarScopes() {
8-
return ["text.html.vue"];
8+
return ["text.html.vue"]
99
}
1010
getLanguageName() {
11-
return "Vue";
11+
return "Vue"
1212
}
1313
getServerName() {
14-
return "Vetur";
14+
return "Vetur"
1515
}
1616

1717
startServerProcess() {
1818
return super.spawnChildNode(["node_modules/vls/dist/vueServerMain"], {
19-
cwd: path.join(__dirname, "..")
20-
});
19+
cwd: path.join(__dirname, ".."),
20+
})
2121
}
2222

2323
preInitialization() {
24-
renameGrammarForScopeName("text.html.vue", "Vue");
24+
renameGrammarForScopeName("text.html.vue", "Vue")
2525
}
2626

2727
getInitializeParams(projectPath, process) {
@@ -31,9 +31,9 @@ class VueLanguageClient extends AutoLanguageClient {
3131

3232
return {
3333
...super.getInitializeParams(projectPath, process),
34-
initializationOptions
35-
};
34+
initializationOptions,
35+
}
3636
}
3737
}
3838

39-
module.exports = new VueLanguageClient();
39+
module.exports = new VueLanguageClient()

spec/fixture.vue

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
<template>
22
<splide :options="options">
33
<splide-slide>
4-
<img src="image1.jpg">
4+
<img src="image1.jpg" />
55
</splide-slide>
66
<splide-slide>
7-
<img src="image2.jpg">
7+
<img src="image2.jpg" />
88
</splide-slide>
99
<splide-slide>
10-
<img src="image3.jpg">
10+
<img src="image3.jpg" />
1111
</splide-slide>
1212
</splide>
1313
</template>
1414

1515
<script>
16-
let x = 1
17-
export default {
18-
data() {
19-
return {
20-
options: {
21-
rewind : true,
22-
width : 800,
23-
gap : '1rem',
24-
},
25-
};
26-
},
27-
}
16+
let x = 1
17+
export default {
18+
data() {
19+
return {
20+
options: {
21+
rewind: true,
22+
width: 800,
23+
gap: "1rem",
24+
},
25+
}
26+
},
27+
}
2828
</script>

0 commit comments

Comments
 (0)