Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Apr 18, 2022
1 parent a752f17 commit 615eb15
Show file tree
Hide file tree
Showing 131 changed files with 5,125 additions and 5,044 deletions.
5 changes: 5 additions & 0 deletions .vscode/settings.json
@@ -0,0 +1,5 @@
{
"typescript.format.semicolons": "insert",
"editor.insertSpaces": false,
"editor.detectIndentation": false
}
@@ -1,4 +1,4 @@
{
"name": "@volar/typescript-plugin-forward",
"version": "0.0.0"
}
"name": "@volar/typescript-plugin-forward",
"version": "0.0.0"
}
@@ -1,5 +1,8 @@
{
"colorizedBracketPairs": [
["{{", "}}"],
[
"{{",
"}}"
],
]
}
@@ -1,32 +1,100 @@
{
"comments": {
"blockComment": [ "<!--", "-->" ]
"blockComment": [
"<!--",
"-->"
]
},
"brackets": [
["<!--", "-->"],
["<", ">"],
["{", "}"],
["(", ")"]
[
"<!--",
"-->"
],
[
"<",
">"
],
[
"{",
"}"
],
[
"(",
")"
]
],
"autoClosingPairs": [
// html
{ "open": "{", "close": "}"},
{ "open": "[", "close": "]"},
{ "open": "(", "close": ")" },
{ "open": "'", "close": "'" },
{ "open": "\"", "close": "\"" },
{ "open": "<!--", "close": "-->", "notIn": [ "comment", "string" ]},
{
"open": "{",
"close": "}"
},
{
"open": "[",
"close": "]"
},
{
"open": "(",
"close": ")"
},
{
"open": "'",
"close": "'"
},
{
"open": "\"",
"close": "\""
},
{
"open": "<!--",
"close": "-->",
"notIn": [
"comment",
"string"
]
},
// javascript
{ "open": "`", "close": "`", "notIn": ["string", "comment"] },
{ "open": "/**", "close": " */", "notIn": ["string"] }
{
"open": "`",
"close": "`",
"notIn": [
"string",
"comment"
]
},
{
"open": "/**",
"close": " */",
"notIn": [
"string"
]
}
],
"surroundingPairs": [
{ "open": "'", "close": "'" },
{ "open": "\"", "close": "\"" },
{ "open": "{", "close": "}"},
{ "open": "[", "close": "]"},
{ "open": "(", "close": ")" },
{ "open": "<", "close": ">" }
{
"open": "'",
"close": "'"
},
{
"open": "\"",
"close": "\""
},
{
"open": "{",
"close": "}"
},
{
"open": "[",
"close": "]"
},
{
"open": "(",
"close": ")"
},
{
"open": "<",
"close": ">"
}
],
"colorizedBracketPairs": [],
"folding": {
Expand Down
Expand Up @@ -37,6 +37,6 @@ export async function activate(context: vscode.ExtensionContext, languageClient:
}
</script>
`
`;
}));
}
Expand Up @@ -14,7 +14,7 @@ export async function activate(context: vscode.ExtensionContext) {

if (!await fs.exists(newTemplateUri)) {
const template = await vscode.workspace.fs.readFile(templateUri);
vscode.workspace.fs.writeFile(newTemplateUri, template)
vscode.workspace.fs.writeFile(newTemplateUri, template);
}

const document = await vscode.workspace.openTextDocument(newTemplateUri);
Expand Down
Expand Up @@ -9,7 +9,7 @@ const localize = nls.loadMessageBundle();
export async function activate(context: vscode.ExtensionContext, languageClient: CommonLanguageClient) {

await languageClient.onReady();
const schemaDocuments: { [uri: string]: boolean } = {};
const schemaDocuments: { [uri: string]: boolean; } = {};

context.subscriptions.push(languageClient.onRequest(shared.GetDocumentContentRequest.type, handle => {
const uri = vscode.Uri.parse(handle.uri);
Expand Down
Expand Up @@ -50,7 +50,7 @@ export async function activate(context: vscode.ExtensionContext) {
}
});

const sfcs = new WeakMap<vscode.TextDocument, { version: number, sfc: SFCParseResult }>();
const sfcs = new WeakMap<vscode.TextDocument, { version: number, sfc: SFCParseResult; }>();

class FinderPanelSerializer implements vscode.WebviewPanelSerializer {
async deserializeWebviewPanel(panel: vscode.WebviewPanel, state: PreviewState) {
Expand All @@ -62,7 +62,7 @@ export async function activate(context: vscode.ExtensionContext) {

const port = await openPreview(PreviewType.Webview, state.fileName, '', state.mode, panel);

panel.webview.html = getWebviewContent(`http://localhost:${port}`, state)
panel.webview.html = getWebviewContent(`http://localhost:${port}`, state);
}
}

Expand Down Expand Up @@ -360,7 +360,7 @@ export async function activate(context: vscode.ExtensionContext) {
}
}

async function handleGoToCode(fileName: string, range: [number, number], cancleToken: { readonly isCancelled: boolean }) {
async function handleGoToCode(fileName: string, range: [number, number], cancleToken: { readonly isCancelled: boolean; }) {

const doc = await vscode.workspace.openTextDocument(fileName);

Expand Down
Expand Up @@ -79,7 +79,7 @@ export function userPick(options: Record<string, vscode.QuickPickItem>, placehol
quickPick.onDidHide(() => {
quickPick.dispose();
resolve(undefined);
})
});
quickPick.show();
});
}
Expand Up @@ -128,7 +128,7 @@ function getVscodeTsPaths() {
return {
serverPath: shared.getVscodeTypescriptPath(vscode.env.appRoot),
localizedPath: shared.getVscodeTypescriptLocalizedPath(vscode.env.appRoot, vscode.env.language),
}
};
}

function getTsdk() {
Expand Down
14 changes: 7 additions & 7 deletions extensions/vscode-vue-language-features/src/utils/fs.ts
@@ -1,11 +1,11 @@
import * as vscode from 'vscode';

export async function exists(uri: vscode.Uri) {
try {
await vscode.workspace.fs.stat(uri);
return true;
}
catch {
return false;
}
try {
await vscode.workspace.fs.stat(uri);
return true;
}
catch {
return false;
}
}
10 changes: 5 additions & 5 deletions lerna.json
@@ -1,7 +1,7 @@
{
"packages": [
"extensions/*",
"packages/*"
],
"version": "0.34.7"
"packages": [
"extensions/*",
"packages/*"
],
"version": "0.34.7"
}
70 changes: 35 additions & 35 deletions packages/preview/bin/nuxi/configExtraContent.ts
@@ -1,53 +1,53 @@

if (!module.exports.default)
module.exports.default = {};
module.exports.default = {};

if (!module.exports.default.vue)
module.exports.default.vue = {};
module.exports.default.vue = {};

if (!module.exports.default.vue.compilerOptions)
module.exports.default.vue.compilerOptions = {};
module.exports.default.vue.compilerOptions = {};

if (!module.exports.default.vue.compilerOptions.nodeTransforms)
module.exports.default.vue.compilerOptions.nodeTransforms = [];
module.exports.default.vue.compilerOptions.nodeTransforms = [];

module.exports.default.vue.compilerOptions.nodeTransforms.push(
(node, ctx) => {
if (node.type === 1) {
const start = node.loc.start.offset;
const end = node.loc.end.offset;
addEvent(node, 'pointerenter', `$volar.highlight($event.target, $.type.__file, [${start},${end}])`);
addEvent(node, 'pointerleave', '$volar.unHighlight($event.target)');
addEvent(node, 'vnode-mounted', `$volar.vnodeMounted($event.el, $.type.__file, [${start},${end}])`);
addEvent(node, 'vnode-unmounted', '$volar.vnodeUnmounted($event.el)');
}
}
(node, ctx) => {
if (node.type === 1) {
const start = node.loc.start.offset;
const end = node.loc.end.offset;
addEvent(node, 'pointerenter', `$volar.highlight($event.target, $.type.__file, [${start},${end}])`);
addEvent(node, 'pointerleave', '$volar.unHighlight($event.target)');
addEvent(node, 'vnode-mounted', `$volar.vnodeMounted($event.el, $.type.__file, [${start},${end}])`);
addEvent(node, 'vnode-unmounted', '$volar.vnodeUnmounted($event.el)');
}
}
);

if (!module.exports.default.plugins)
module.exports.default.plugins = [];
module.exports.default.plugins = [];

module.exports.default.plugins.push({ src: '{PLUGIN_PATH}', ssr: false });

function addEvent(node, name: string, exp: string) {
node.props.push({
type: 7,
name: 'on',
exp: {
type: 4,
content: exp,
isStatic: false,
constType: 0,
loc: node.loc,
},
arg: {
type: 4,
content: name,
isStatic: true,
constType: 3,
loc: node.loc,
},
modifiers: [],
loc: node.loc,
});
node.props.push({
type: 7,
name: 'on',
exp: {
type: 4,
content: exp,
isStatic: false,
constType: 0,
loc: node.loc,
},
arg: {
type: 4,
content: name,
isStatic: true,
constType: 3,
loc: node.loc,
},
modifiers: [],
loc: node.loc,
});
}

0 comments on commit 615eb15

Please sign in to comment.