Skip to content

Commit 532bc23

Browse files
committed
For user experience. disable the show reference count feature because has bug.
1 parent 86746e5 commit 532bc23

6 files changed

Lines changed: 7 additions & 60 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
### v1.8.2
2+
- For user experience. disable the show reference count feature because has bug.
13
### v1.8.0
24
- Improve rename feature.
35
- Support snippets Join and Create UDF.

out/extension.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

out/extension.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flink-sql",
3-
"version": "1.8.0",
3+
"version": "1.8.2",
44
"displayName": "Flink SQL Checker",
55
"description": "Support Flink SQL grammar check, syntax highlighting, complete keywords, rename and code format, including user-defined functions",
66
"publisher": "CamileSing",
@@ -59,7 +59,6 @@
5959
"configuration": "./language-configuration.json",
6060
"capabilities" : {
6161
"renameProvider" : "true",
62-
"resolveProvider": "true",
6362
"referencesProvider" : "true"
6463
}
6564
}

src/extension.ts

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ export function activate(context: ExtensionContext) {
3232
// 获取初始配置
3333
updateFeatureStatus();
3434

35-
context.subscriptions.push(vscode.languages.registerCodeLensProvider(
36-
[{ pattern: '**/*.sql' }, { pattern: '**/*.fql' }],
37-
new FqlCodeLensProvider()
38-
));
39-
4035
context.subscriptions.push(vscode.languages.registerReferenceProvider(
4136
[{ pattern: '**/*.sql' }, { pattern: '**/*.fql' }],
4237
new FqlReferenceProvider()
@@ -149,55 +144,6 @@ class FqlRenameProvider implements vscode.RenameProvider {
149144
}
150145

151146

152-
153-
class FqlCodeLensProvider implements vscode.CodeLensProvider {
154-
155-
156-
provideCodeLenses(document: vscode.TextDocument, token: vscode.CancellationToken): vscode.ProviderResult<vscode.CodeLens[]> {
157-
const codeLenses = [];
158-
for (let line = 0; line < document.lineCount; line++) {
159-
const lineOfCode = document.lineAt(line);
160-
// 添加你的SQL语法检测逻辑
161-
if (/CREATE TEMPORARY|CREATE TABLE/i.test(lineOfCode.text)) {
162-
codeLenses.push(new vscode.CodeLens(lineOfCode.range));
163-
}
164-
}
165-
return codeLenses;
166-
}
167-
resolveCodeLens?(codeLens: vscode.CodeLens, token: vscode.CancellationToken): vscode.ProviderResult<vscode.CodeLens> {
168-
const editor = vscode.window.activeTextEditor;
169-
if (!editor) {
170-
return;
171-
}
172-
173-
const document = editor.document;
174-
const tableName = document.getText(codeLens.range);
175-
const references = this.findReferences(document, tableName);
176-
177-
if (references.length > 0) {
178-
codeLens.command = {
179-
title: `${references.length} reference(s) to ${tableName}`,
180-
command: "extension.showReferences",
181-
arguments: [document.uri, codeLens.range.start, references]
182-
};
183-
}
184-
return codeLens;
185-
}
186-
187-
findReferences(document: vscode.TextDocument | undefined, tableName: string | undefined): vscode.Range[] {
188-
const references = [];
189-
if (document && tableName) {
190-
for (let line = 0; line < document.lineCount; line++) {
191-
const lineOfCode = document.lineAt(line);
192-
if (lineOfCode.text.includes(tableName)) {
193-
references.push(lineOfCode.range);
194-
}
195-
}
196-
}
197-
return references;
198-
}
199-
}
200-
201147
class FqlReferenceProvider implements vscode.ReferenceProvider {
202148
provideReferences(document: vscode.TextDocument, position: vscode.Position, options: { includeDeclaration: boolean }, token: vscode.CancellationToken): vscode.ProviderResult<vscode.Location[]> {
203149
const wordRange = document.getWordRangeAtPosition(position);

0 commit comments

Comments
 (0)