mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from vscode 6fded8a497cd0142de3a1c607649a5423a091a25
This commit is contained in:
@@ -51,7 +51,7 @@ export class AuthenticationService extends Disposable implements IAuthentication
|
||||
this._placeholderMenuItem = MenuRegistry.appendMenuItem(MenuId.AccountsContext, {
|
||||
command: {
|
||||
id: 'noAuthenticationProviders',
|
||||
title: nls.localize('noAuthenticationProviders', "No authentication providers registered")
|
||||
title: nls.localize('loading', "Loading...")
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -78,7 +78,7 @@ export class AuthenticationService extends Disposable implements IAuthentication
|
||||
this._placeholderMenuItem = MenuRegistry.appendMenuItem(MenuId.AccountsContext, {
|
||||
command: {
|
||||
id: 'noAuthenticationProviders',
|
||||
title: nls.localize('noAuthenticationProviders', "No authentication providers registered")
|
||||
title: nls.localize('loading', "Loading...")
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -192,19 +192,19 @@ export class WorkspaceService extends Disposable implements IConfigurationServic
|
||||
|
||||
const storedFoldersToAdd: IStoredWorkspaceFolder[] = [];
|
||||
|
||||
await Promise.all(foldersToAdd.map(async folderToAdd => {
|
||||
for (const folderToAdd of foldersToAdd) {
|
||||
const folderURI = folderToAdd.uri;
|
||||
if (this.contains(currentWorkspaceFolderUris, folderURI)) {
|
||||
return; // already existing
|
||||
continue; // already existing
|
||||
}
|
||||
try {
|
||||
const result = await this.fileService.resolve(folderURI);
|
||||
if (!result.isDirectory) {
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
} catch (e) { /* Ignore */ }
|
||||
storedFoldersToAdd.push(getStoredWorkspaceFolder(folderURI, false, folderToAdd.name, workspaceConfigFolder, slashForPath));
|
||||
}));
|
||||
}
|
||||
|
||||
// Apply to array of newStoredFolders
|
||||
if (storedFoldersToAdd.length > 0) {
|
||||
|
||||
@@ -74,6 +74,9 @@ export class CodeEditorService extends CodeEditorServiceImpl {
|
||||
if (isCodeEditor(widget)) {
|
||||
return widget;
|
||||
}
|
||||
if (isCompositeEditor(widget) && isCodeEditor(widget.activeCodeEditor)) {
|
||||
return widget.activeCodeEditor;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -15,7 +15,7 @@ import * as objects from 'vs/base/common/objects';
|
||||
import { StopWatch } from 'vs/base/common/stopwatch';
|
||||
import * as strings from 'vs/base/common/strings';
|
||||
import { URI, UriComponents } from 'vs/base/common/uri';
|
||||
import { compareItemsByScore, IItemAccessor, prepareQuery, ScorerCache } from 'vs/base/common/fuzzyScorer';
|
||||
import { compareItemsByFuzzyScore, IItemAccessor, prepareQuery, FuzzyScorerCache } from 'vs/base/common/fuzzyScorer';
|
||||
import { MAX_FILE_SIZE } from 'vs/base/node/pfs';
|
||||
import { ICachedSearchStats, IFileQuery, IFileSearchStats, IFolderQuery, IProgressMessage, IRawFileQuery, IRawQuery, IRawTextQuery, ITextQuery, IFileSearchProgressItem, IRawFileMatch, IRawSearchService, ISearchEngine, ISearchEngineSuccess, ISerializedFileMatch, ISerializedSearchComplete, ISerializedSearchProgressItem, ISerializedSearchSuccess, isFilePatternMatch } from 'vs/workbench/services/search/common/search';
|
||||
import { Engine as FileSearchEngine } from 'vs/workbench/services/search/node/fileSearch';
|
||||
@@ -179,7 +179,7 @@ export class SearchService implements IRawSearchService {
|
||||
}
|
||||
|
||||
return allResultsPromise.then(([result, results]) => {
|
||||
const scorerCache: ScorerCache = cache ? cache.scorerCache : Object.create(null);
|
||||
const scorerCache: FuzzyScorerCache = cache ? cache.scorerCache : Object.create(null);
|
||||
const sortSW = (typeof config.maxResults !== 'number' || config.maxResults > 0) && StopWatch.create(false);
|
||||
return this.sortResults(config, results, scorerCache, token)
|
||||
.then<[ISerializedSearchSuccess, IRawFileMatch[]]>(sortedResults => {
|
||||
@@ -246,13 +246,13 @@ export class SearchService implements IRawSearchService {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
private sortResults(config: IFileQuery, results: IRawFileMatch[], scorerCache: ScorerCache, token?: CancellationToken): Promise<IRawFileMatch[]> {
|
||||
private sortResults(config: IFileQuery, results: IRawFileMatch[], scorerCache: FuzzyScorerCache, token?: CancellationToken): Promise<IRawFileMatch[]> {
|
||||
// we use the same compare function that is used later when showing the results using fuzzy scoring
|
||||
// this is very important because we are also limiting the number of results by config.maxResults
|
||||
// and as such we want the top items to be included in this result set if the number of items
|
||||
// exceeds config.maxResults.
|
||||
const query = prepareQuery(config.filePattern || '');
|
||||
const compare = (matchA: IRawFileMatch, matchB: IRawFileMatch) => compareItemsByScore(matchA, matchB, query, true, FileMatchItemAccessor, scorerCache);
|
||||
const compare = (matchA: IRawFileMatch, matchB: IRawFileMatch) => compareItemsByFuzzyScore(matchA, matchB, query, true, FileMatchItemAccessor, scorerCache);
|
||||
|
||||
const maxResults = typeof config.maxResults === 'number' ? config.maxResults : Number.MAX_VALUE;
|
||||
return arrays.topAsync(results, compare, maxResults, 10000, token);
|
||||
@@ -408,7 +408,7 @@ class Cache {
|
||||
|
||||
resultsToSearchCache: { [searchValue: string]: ICacheRow; } = Object.create(null);
|
||||
|
||||
scorerCache: ScorerCache = Object.create(null);
|
||||
scorerCache: FuzzyScorerCache = Object.create(null);
|
||||
}
|
||||
|
||||
const FileMatchItemAccessor = new class implements IItemAccessor<IRawFileMatch> {
|
||||
|
||||
@@ -17,6 +17,7 @@ import { IUntitledTextEditorService } from 'vs/workbench/services/untitled/commo
|
||||
import { TextFileEditorModel } from 'vs/workbench/services/textfile/common/textFileEditorModel';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
|
||||
class ResourceModelCollection extends ReferenceCollection<Promise<ITextEditorModel>> {
|
||||
|
||||
@@ -26,7 +27,8 @@ class ResourceModelCollection extends ReferenceCollection<Promise<ITextEditorMod
|
||||
constructor(
|
||||
@IInstantiationService private readonly instantiationService: IInstantiationService,
|
||||
@ITextFileService private readonly textFileService: ITextFileService,
|
||||
@IFileService private readonly fileService: IFileService
|
||||
@IFileService private readonly fileService: IFileService,
|
||||
@ITelemetryService private readonly telemetryService: ITelemetryService,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
@@ -110,6 +112,21 @@ class ResourceModelCollection extends ReferenceCollection<Promise<ITextEditorMod
|
||||
const providers = this.providers[resource.scheme] || [];
|
||||
const factories = providers.map(p => () => Promise.resolve(p.provideTextContent(resource)));
|
||||
|
||||
if (resource.query || resource.fragment) {
|
||||
type TextModelResolverUri = {
|
||||
query: boolean;
|
||||
fragment: boolean;
|
||||
};
|
||||
type TextModelResolverUriMeta = {
|
||||
query: { classification: 'SystemMetaData', purpose: 'FeatureInsight' };
|
||||
fragment: { classification: 'SystemMetaData', purpose: 'FeatureInsight' };
|
||||
};
|
||||
this.telemetryService.publicLog2<TextModelResolverUri, TextModelResolverUriMeta>('textmodelresolveruri', {
|
||||
query: Boolean(resource.query),
|
||||
fragment: Boolean(resource.fragment)
|
||||
});
|
||||
}
|
||||
|
||||
const model = await first(factories);
|
||||
if (!model) {
|
||||
throw new Error('resource is not available');
|
||||
|
||||
@@ -147,7 +147,6 @@ export class ThemeRegistry<T extends IThemeData> {
|
||||
for (let ext of extensions) {
|
||||
if (this.isProposedApi) {
|
||||
checkProposedApiEnabled(ext.description);
|
||||
return;
|
||||
}
|
||||
let extensionData: ExtensionData = {
|
||||
extensionId: ext.description.identifier.value,
|
||||
|
||||
Reference in New Issue
Block a user