mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
fix for findSubstr not doing URI.file(<filename>).fspath (#2441)
This commit is contained in:
@@ -12,6 +12,7 @@ import { ExtHostExtensionService } from 'vs/workbench/api/node/extHostExtensionS
|
|||||||
import { IExtensionDescription } from 'vs/workbench/services/extensions/common/extensions';
|
import { IExtensionDescription } from 'vs/workbench/services/extensions/common/extensions';
|
||||||
import { realpath } from 'fs';
|
import { realpath } from 'fs';
|
||||||
import * as extHostTypes from 'vs/workbench/api/node/extHostTypes';
|
import * as extHostTypes from 'vs/workbench/api/node/extHostTypes';
|
||||||
|
import URI from 'vs/base/common/uri';
|
||||||
|
|
||||||
import * as sqlops from 'sqlops';
|
import * as sqlops from 'sqlops';
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
@@ -482,7 +483,7 @@ function defineAPI(factory: ISqlExtensionApiFactory, extensionPaths: TrieMap<IEx
|
|||||||
setDefaultApiImpl: (defaultImpl: ApiImpl) => void,
|
setDefaultApiImpl: (defaultImpl: ApiImpl) => void,
|
||||||
parent: any): ApiImpl {
|
parent: any): ApiImpl {
|
||||||
// get extension id from filename and api for extension
|
// get extension id from filename and api for extension
|
||||||
const ext = extensionPaths.findSubstr(parent.filename);
|
const ext = extensionPaths.findSubstr(URI.file(parent.filename).fsPath);
|
||||||
if (ext) {
|
if (ext) {
|
||||||
let apiImpl = apiMap.get(ext.id);
|
let apiImpl = apiMap.get(ext.id);
|
||||||
if (!apiImpl) {
|
if (!apiImpl) {
|
||||||
@@ -494,6 +495,7 @@ function defineAPI(factory: ISqlExtensionApiFactory, extensionPaths: TrieMap<IEx
|
|||||||
|
|
||||||
// fall back to a default implementation
|
// fall back to a default implementation
|
||||||
if (!defaultImpl) {
|
if (!defaultImpl) {
|
||||||
|
console.warn(`Could not identify extension for 'vscode' require call from ${parent.filename}`);
|
||||||
defaultImpl = createApi(nullExtensionDescription);
|
defaultImpl = createApi(nullExtensionDescription);
|
||||||
setDefaultApiImpl(defaultImpl);
|
setDefaultApiImpl(defaultImpl);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user