Skip to content

Commit

Permalink
Merge branch 'master' into dom-api-inspect-editor-tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
aeschli authored Aug 28, 2020
2 parents 0cdb5b1 + c023937 commit 5c01fcc
Show file tree
Hide file tree
Showing 78 changed files with 1,465 additions and 759 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: "Code Scanning"

on: [push, pull_request]
on:
schedule:
- cron: '0 0 * * 2'

jobs:
CodeQL-Build:
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/rich-navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,10 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
- name: Install dependencies
run: yarn --frozen-lockfile
env:
CHILD_CONCURRENCY: 1
- name: Install .NET Core 2.2
uses: actions/setup-dotnet@v1.5.0
with:
dotnet-version: 2.2
- uses: microsoft/RichCodeNavIndexer@v0.1
with:
languages: typescript
Expand Down
9 changes: 7 additions & 2 deletions extensions/github-authentication/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"web"
],
"activationEvents": [
"*",
"onAuthenticationRequest:github"
],
"contributes": {
Expand All @@ -34,7 +33,13 @@
"when": "false"
}
]
}
},
"authentication": [
{
"label": "GitHub",
"id": "github"
}
]
},
"aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
"main": "./out/extension.js",
Expand Down
9 changes: 8 additions & 1 deletion extensions/microsoft-authentication/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,21 @@
],
"enableProposedApi": true,
"activationEvents": [
"*",
"onAuthenticationRequest:microsoft"
],
"extensionKind": [
"ui",
"workspace",
"web"
],
"contributes": {
"authentication": [
{
"label": "Microsoft",
"id": "microsoft"
}
]
},
"aiKey": "AIF-d9b70cd4-b9f9-4d70-929b-a071c400b217",
"main": "./out/extension.js",
"browser": "./dist/browser/extension.js",
Expand Down
8 changes: 7 additions & 1 deletion extensions/vscode-notebook-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@
"group": "inline@1"
}
]
}
},
"jsonValidation": [
{
"fileMatch": "vscode://vscode-notebook-cell-metadata/*",
"url": "vscode://schemas/notebook/cellmetadata"
}
]
}
}
2 changes: 1 addition & 1 deletion product.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
},
{
"name": "ms-vscode.js-debug-companion",
"version": "1.0.5",
"version": "1.0.6",
"repo": "https://github.com/microsoft/vscode-js-debug-companion",
"metadata": {
"id": "99cb0b7f-7354-4278-b8da-6cc79972169d",
Expand Down
2 changes: 1 addition & 1 deletion resources/web/code-web.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const BUILTIN_MARKETPLACE_EXTENSIONS_ROOT = path.join(APP_ROOT, '.build', 'built
const WEB_DEV_EXTENSIONS_ROOT = path.join(APP_ROOT, '.build', 'builtInWebDevExtensions');
const WEB_MAIN = path.join(APP_ROOT, 'src', 'vs', 'code', 'browser', 'workbench', 'workbench-dev.html');

const WEB_PLAYGROUND_VERSION = '0.0.2';
const WEB_PLAYGROUND_VERSION = '0.0.4';

const args = minimist(process.argv, {
boolean: [
Expand Down
1 change: 1 addition & 0 deletions src/vs/base/browser/ui/splitview/paneview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export interface IPaneOptions {
expanded?: boolean;
orientation?: Orientation;
title: string;
titleDescription?: string;
}

export interface IPaneStyles {
Expand Down
9 changes: 9 additions & 0 deletions src/vs/base/common/fuzzyScorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ function doScoreItemFuzzySingle(label: string, description: string | undefined,
if (preferLabelMatches || !description) {
const [labelScore, labelPositions] = scoreFuzzy(label, query.normalized, query.normalizedLowercase, fuzzy);
if (labelScore) {

// If we have a prefix match on the label, we give a much
// higher baseScore to elevate these matches over others
// This ensures that typing a file name wins over results
Expand All @@ -472,6 +473,14 @@ function doScoreItemFuzzySingle(label: string, description: string | undefined,
let baseScore: number;
if (labelPrefixMatch) {
baseScore = LABEL_PREFIX_SCORE_THRESHOLD;

// We give another boost to labels that are short, e.g. given
// files "window.ts" and "windowActions.ts" and a query of
// "window", we want "window.ts" to receive a higher score.
// As such we compute the percentage the query has within the
// label and add that to the baseScore.
const prefixLengthBoost = Math.round((query.normalized.length / label.length) * 100);
baseScore += prefixLengthBoost;
} else {
baseScore = LABEL_SCORE_THRESHOLD;
}
Expand Down
30 changes: 30 additions & 0 deletions src/vs/base/test/common/fuzzyScorer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,36 @@ suite('Fuzzy Scorer', () => {
}
});

test('compareFilesByScore - boost shorter prefix match if multiple queries are used', function () {
const resourceA = URI.file('src/vs/workbench/browser/actions/windowActions.ts');
const resourceB = URI.file('src/vs/workbench/electron-browser/window.ts');

for (const query of ['window browser', 'window.ts browser']) {
let res = [resourceA, resourceB].sort((r1, r2) => compareItemsByScore(r1, r2, query, true, ResourceAccessor));
assert.equal(res[0], resourceB);
assert.equal(res[1], resourceA);

res = [resourceB, resourceA].sort((r1, r2) => compareItemsByScore(r1, r2, query, true, ResourceAccessor));
assert.equal(res[0], resourceB);
assert.equal(res[1], resourceA);
}
});

test('compareFilesByScore - boost shorter prefix match if multiple queries are used (#99171)', function () {
const resourceA = URI.file('mesh_editor_lifetime_job.h');
const resourceB = URI.file('lifetime_job.h');

for (const query of ['m life, life m']) {
let res = [resourceA, resourceB].sort((r1, r2) => compareItemsByScore(r1, r2, query, true, ResourceAccessor));
assert.equal(res[0], resourceB);
assert.equal(res[1], resourceA);

res = [resourceB, resourceA].sort((r1, r2) => compareItemsByScore(r1, r2, query, true, ResourceAccessor));
assert.equal(res[0], resourceB);
assert.equal(res[1], resourceA);
}
});

test('prepareQuery', () => {
assert.equal(scorer.prepareQuery(' f*a ').normalized, 'fa');
assert.equal(scorer.prepareQuery('model Tester.ts').original, 'model Tester.ts');
Expand Down
Loading

0 comments on commit 5c01fcc

Please sign in to comment.