mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode aba87f135229c17c4624341b7a2499dcedafcb87 (#6430)
* Merge from vscode aba87f135229c17c4624341b7a2499dcedafcb87 * fix compile errors
This commit is contained in:
@@ -1246,12 +1246,18 @@
|
||||
},
|
||||
"git.ignoredRepositories": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"default": [],
|
||||
"scope": "window",
|
||||
"description": "%config.ignoredRepositories%"
|
||||
},
|
||||
"git.scanRepositories": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"default": [],
|
||||
"scope": "resource",
|
||||
"description": "%config.scanRepositories%"
|
||||
|
||||
@@ -10,7 +10,7 @@ import { xhr, XHRResponse, getErrorStatusDescription } from 'request-light';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
import { workspace, window, languages, commands, ExtensionContext, extensions, Uri, LanguageConfiguration, Diagnostic, StatusBarAlignment, TextEditor, TextDocument, Position, SelectionRange } from 'vscode';
|
||||
import { workspace, window, languages, commands, ExtensionContext, extensions, Uri, LanguageConfiguration, Diagnostic, StatusBarAlignment, TextEditor } from 'vscode';
|
||||
import { LanguageClient, LanguageClientOptions, RequestType, ServerOptions, TransportKind, NotificationType, DidChangeConfigurationNotification, HandleDiagnosticsSignature, ResponseError } from 'vscode-languageclient';
|
||||
import TelemetryReporter from 'vscode-extension-telemetry';
|
||||
|
||||
@@ -216,26 +216,6 @@ export function activate(context: ExtensionContext) {
|
||||
extensions.onDidChange(_ => {
|
||||
client.sendNotification(SchemaAssociationNotification.type, getSchemaAssociation(context));
|
||||
});
|
||||
|
||||
documentSelector.forEach(selector => {
|
||||
toDispose.push(languages.registerSelectionRangeProvider(selector, {
|
||||
async provideSelectionRanges(document: TextDocument, positions: Position[]): Promise<SelectionRange[]> {
|
||||
const textDocument = client.code2ProtocolConverter.asTextDocumentIdentifier(document);
|
||||
const rawResult = await client.sendRequest<SelectionRange[][]>('$/textDocument/selectionRanges', { textDocument, positions: positions.map(client.code2ProtocolConverter.asPosition) });
|
||||
if (Array.isArray(rawResult)) {
|
||||
return rawResult.map(rawSelectionRanges => {
|
||||
return rawSelectionRanges.reduceRight((parent: SelectionRange | undefined, selectionRange: SelectionRange) => {
|
||||
return {
|
||||
range: client.protocol2CodeConverter.asRange(selectionRange.range),
|
||||
parent,
|
||||
};
|
||||
}, undefined)!;
|
||||
});
|
||||
}
|
||||
return [];
|
||||
}
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -433,7 +433,8 @@ connection.onFoldingRanges((params, token) => {
|
||||
}, null, `Error while computing folding ranges for ${params.textDocument.uri}`, token);
|
||||
});
|
||||
|
||||
connection.onRequest('$/textDocument/selectionRanges', async (params, token) => {
|
||||
|
||||
connection.onSelectionRanges((params, token) => {
|
||||
return runSafe(() => {
|
||||
const document = documents.get(params.textDocument.uri);
|
||||
if (document) {
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
"description": "%description%",
|
||||
"version": "1.0.0",
|
||||
"icon": "icon.png",
|
||||
"publisher": "vscode",
|
||||
"enableProposedApi": true,
|
||||
"publisher": "vscode",
|
||||
"enableProposedApi": true,
|
||||
"license": "MIT",
|
||||
"aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
|
||||
"engines": {
|
||||
@@ -197,6 +197,9 @@
|
||||
"properties": {
|
||||
"markdown.styles": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"default": [],
|
||||
"description": "%markdown.styles.dec%",
|
||||
"scope": "resource"
|
||||
|
||||
@@ -15,9 +15,11 @@ export class ShowSourceCommand implements Command {
|
||||
) { }
|
||||
|
||||
public execute() {
|
||||
if (this.previewManager.activePreviewResource) {
|
||||
return vscode.workspace.openTextDocument(this.previewManager.activePreviewResource)
|
||||
.then(document => vscode.window.showTextDocument(document));
|
||||
const { activePreviewResource, activePreviewResourceColumn } = this.previewManager;
|
||||
if (activePreviewResource && activePreviewResourceColumn) {
|
||||
return vscode.workspace.openTextDocument(activePreviewResource).then(document => {
|
||||
vscode.window.showTextDocument(document, activePreviewResourceColumn);
|
||||
});
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -102,11 +102,13 @@ export class MarkdownPreview extends Disposable {
|
||||
const resource = vscode.Uri.parse(state.resource);
|
||||
const locked = state.locked;
|
||||
const line = state.line;
|
||||
const resourceColumn = state.resourceColumn;
|
||||
|
||||
const preview = new MarkdownPreview(
|
||||
webview,
|
||||
resource,
|
||||
locked,
|
||||
resourceColumn,
|
||||
contentProvider,
|
||||
previewConfigurations,
|
||||
logger,
|
||||
@@ -125,6 +127,7 @@ export class MarkdownPreview extends Disposable {
|
||||
public static create(
|
||||
resource: vscode.Uri,
|
||||
previewColumn: vscode.ViewColumn,
|
||||
resourceColumn: vscode.ViewColumn,
|
||||
locked: boolean,
|
||||
contentProvider: MarkdownContentProvider,
|
||||
previewConfigurations: MarkdownPreviewConfigurationManager,
|
||||
@@ -144,6 +147,7 @@ export class MarkdownPreview extends Disposable {
|
||||
webview,
|
||||
resource,
|
||||
locked,
|
||||
resourceColumn,
|
||||
contentProvider,
|
||||
previewConfigurations,
|
||||
logger,
|
||||
@@ -155,6 +159,7 @@ export class MarkdownPreview extends Disposable {
|
||||
webview: vscode.WebviewPanel,
|
||||
resource: vscode.Uri,
|
||||
locked: boolean,
|
||||
private readonly _resourceColumn: vscode.ViewColumn,
|
||||
private readonly _contentProvider: MarkdownContentProvider,
|
||||
private readonly _previewConfigurations: MarkdownPreviewConfigurationManager,
|
||||
private readonly _logger: Logger,
|
||||
@@ -249,11 +254,16 @@ export class MarkdownPreview extends Disposable {
|
||||
return this._resource;
|
||||
}
|
||||
|
||||
public get resourceColumn(): vscode.ViewColumn {
|
||||
return this._resourceColumn;
|
||||
}
|
||||
|
||||
public get state() {
|
||||
return {
|
||||
resource: this.resource.toString(),
|
||||
locked: this._locked,
|
||||
line: this.line,
|
||||
resourceColumn: this.resourceColumn,
|
||||
imageInfo: this.imageInfo
|
||||
};
|
||||
}
|
||||
|
||||
@@ -65,6 +65,10 @@ export class MarkdownPreviewManager extends Disposable implements vscode.Webview
|
||||
return this._activePreview && this._activePreview.resource;
|
||||
}
|
||||
|
||||
public get activePreviewResourceColumn() {
|
||||
return this._activePreview && this._activePreview.resourceColumn;
|
||||
}
|
||||
|
||||
public toggleLock() {
|
||||
const preview = this._activePreview;
|
||||
if (preview) {
|
||||
@@ -110,6 +114,7 @@ export class MarkdownPreviewManager extends Disposable implements vscode.Webview
|
||||
const preview = MarkdownPreview.create(
|
||||
resource,
|
||||
previewSettings.previewColumn,
|
||||
previewSettings.resourceColumn,
|
||||
previewSettings.locked,
|
||||
this._contentProvider,
|
||||
this._previewConfigurations,
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
".dita",
|
||||
".ditamap",
|
||||
".dtd",
|
||||
".ent",
|
||||
".mod",
|
||||
".dtml",
|
||||
".fsproj",
|
||||
".fxml",
|
||||
|
||||
Reference in New Issue
Block a user