Merge from vscode e558dc6ea73a75bd69d7a0b485f0e7e4194c66bf (#6864)

This commit is contained in:
Anthony Dresser
2019-08-21 20:44:59 -07:00
committed by GitHub
parent d2ae0f0154
commit 985bfae8a0
107 changed files with 2260 additions and 814 deletions

View File

@@ -549,7 +549,7 @@ export function fuzzyScore(pattern: string, patternLow: string, patternPos: numb
const patternStartPos = patternPos;
const wordStartPos = wordPos;
// There will be a mach, fill in tables
// There will be a match, fill in tables
for (patternPos = patternStartPos + 1; patternPos <= patternLen; patternPos++) {
for (wordPos = 1; wordPos <= wordLen; wordPos++) {
@@ -573,6 +573,11 @@ export function fuzzyScore(pattern: string, patternLow: string, patternPos: numb
} else {
score = 5;
}
} else if (isSeparatorAtPos(wordLow, wordPos - 1) && (wordPos === 1 || !isSeparatorAtPos(wordLow, wordPos - 2))) {
// hitting a separator: `. <-> foo.bar`
// ^
score = 5;
} else if (isSeparatorAtPos(wordLow, wordPos - 2) || isWhitespaceAtPos(wordLow, wordPos - 2)) {
// post separator: `foo <-> bar_foo`
// ^^^

View File

@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { URI } from 'vs/base/common/uri';
import * as platform from 'vs/base/common/platform';
export namespace Schemas {
@@ -58,11 +59,17 @@ class RemoteAuthoritiesImpl {
private readonly _hosts: { [authority: string]: string; };
private readonly _ports: { [authority: string]: number; };
private readonly _connectionTokens: { [authority: string]: string; };
private _preferredWebSchema: 'http' | 'https';
constructor() {
this._hosts = Object.create(null);
this._ports = Object.create(null);
this._connectionTokens = Object.create(null);
this._preferredWebSchema = 'http';
}
public setPreferredWebSchema(schema: 'http' | 'https') {
this._preferredWebSchema = schema;
}
public set(authority: string, host: string, port: number): void {
@@ -79,9 +86,9 @@ class RemoteAuthoritiesImpl {
const port = this._ports[authority];
const connectionToken = this._connectionTokens[authority];
return URI.from({
scheme: Schemas.vscodeRemoteResource,
scheme: platform.isWeb ? this._preferredWebSchema : Schemas.vscodeRemoteResource,
authority: `${host}:${port}`,
path: `/vscode-remote2`,
path: `/vscode-remote-resource`,
query: `path=${encodeURIComponent(path)}&tkn=${encodeURIComponent(connectionToken)}`
});
}