Skip to content

Commit bc1cc38

Browse files
Merge branch 'main' into do-198248
2 parents b529eb9 + 1564aeb commit bc1cc38

File tree

41 files changed

+275
-185
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+275
-185
lines changed

ThirdPartyNotices.txt

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -545,33 +545,6 @@ to the base-name name of the original file, and an extension of txt, html, or si
545545

546546
---------------------------------------------------------
547547

548-
freebroccolo/atom-language-swift 0.0.0 - MIT
549-
https://github.com/freebroccolo/atom-language-swift
550-
551-
The MIT License (MIT)
552-
553-
Copyright (c) 2014 Darin Morrison
554-
555-
Permission is hereby granted, free of charge, to any person obtaining a copy
556-
of this software and associated documentation files (the "Software"), to deal
557-
in the Software without restriction, including without limitation the rights
558-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
559-
copies of the Software, and to permit persons to whom the Software is
560-
furnished to do so, subject to the following conditions:
561-
562-
The above copyright notice and this permission notice shall be included in all
563-
copies or substantial portions of the Software.
564-
565-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
566-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
567-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
568-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
569-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
570-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
571-
---------------------------------------------------------
572-
573-
---------------------------------------------------------
574-
575548
HTML 5.1 W3C Working Draft 08 October 2015 - W3C Document License
576549
http://www.w3.org/TR/2015/WD-html51-20151008/
577550

@@ -901,6 +874,22 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
901874

902875
---------------------------------------------------------
903876

877+
jtbandes/swift-tmlanguage - MIT
878+
https://github.com/jtbandes/swift-tmlanguage
879+
880+
The MIT License (MIT)
881+
882+
Copyright 2023 Jacob Bandes-Storch
883+
884+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
885+
886+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
887+
888+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
889+
---------------------------------------------------------
890+
891+
---------------------------------------------------------
892+
904893
JuliaEditorSupport/atom-language-julia 0.22.1 - MIT
905894
https://github.com/JuliaEditorSupport/atom-language-julia
906895

cglicenses.json

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -308,25 +308,6 @@
308308
"CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
309309
]
310310
},
311-
{ // Reason: Missing license file
312-
"name": "emitter-listener",
313-
"fullLicenseText": [
314-
"This software is released under the BSD-2-Clause license:",
315-
"Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:",
316-
"",
317-
"1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.",
318-
"",
319-
"2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer",
320-
"in the documentation and/or other materials provided with the distribution.",
321-
"",
322-
"THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT",
323-
"NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE",
324-
"COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,",
325-
"BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED",
326-
"AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT",
327-
"OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
328-
]
329-
},
330311
{ // Reason: Missing license file
331312
"name": "const_format_proc_macros",
332313
"fullLicenseTextUri": "https://raw.githubusercontent.com/rodrimati1992/const_format_crates/b2207af46bfbd9f1a6bd12dbffd10feeea3d9fd7/LICENSE-ZLIB.md"

extensions/git/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@
699699
{
700700
"command": "git.timeline.openCommit",
701701
"title": "%command.timelineOpenCommit%",
702-
"icon": "$(tasklist)",
702+
"icon": "$(diff-multiple)",
703703
"category": "Git"
704704
},
705705
{
@@ -765,13 +765,13 @@
765765
{
766766
"command": "git.viewChanges",
767767
"title": "%command.viewChanges%",
768-
"icon": "$(tasklist)",
768+
"icon": "$(diff-multiple)",
769769
"category": "Git"
770770
},
771771
{
772772
"command": "git.viewStagedChanges",
773773
"title": "%command.viewStagedChanges%",
774-
"icon": "$(tasklist)",
774+
"icon": "$(diff-multiple)",
775775
"category": "Git"
776776
}
777777
],

extensions/git/src/actionButton.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,16 @@ export class CommitActionButton extends AbstractActionButton {
219219
};
220220
}
221221

222+
// Not a branch (tag, detached)
223+
if (this.state.HEAD?.type === RefType.Tag || !this.state.HEAD?.name) {
224+
return {
225+
command: 'git.commit',
226+
title: l10n.t('{0} Commit', '$(check)'),
227+
tooltip: this.state.isCommitInProgress ? l10n.t('Committing Changes...') : l10n.t('Commit Changes'),
228+
arguments: [this.repository.sourceControl, '']
229+
};
230+
}
231+
222232
// Commit
223233
return this.postCommitCommandCenter.getPrimaryCommand();
224234
}
@@ -229,6 +239,11 @@ export class CommitActionButton extends AbstractActionButton {
229239
return [];
230240
}
231241

242+
// Not a branch (tag, detached)
243+
if (this.state.HEAD?.type === RefType.Tag || !this.state.HEAD?.name) {
244+
return [];
245+
}
246+
232247
// Commit
233248
const commandGroups: Command[][] = [];
234249
for (const commands of this.postCommitCommandCenter.getSecondaryCommands()) {

extensions/git/src/historyProvider.ts

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,28 +58,30 @@ export class GitHistoryProvider implements SourceControlHistoryProvider, FileDec
5858
}
5959

6060
private async onDidRunGitStatus(): Promise<void> {
61-
if (!this.repository.HEAD?.name || !this.repository.HEAD?.commit) { return; }
62-
6361
// Check if HEAD has changed
64-
const HEAD = this.repository.HEAD;
65-
66-
if (this._HEAD?.name === HEAD.name &&
67-
this._HEAD?.commit === HEAD.commit &&
68-
this._HEAD?.upstream?.name === HEAD.upstream?.name &&
69-
this._HEAD?.upstream?.remote === HEAD.upstream?.remote &&
70-
this._HEAD?.upstream?.commit === HEAD.upstream?.commit) {
62+
if (this._HEAD?.name === this.repository.HEAD?.name &&
63+
this._HEAD?.commit === this.repository.HEAD?.commit &&
64+
this._HEAD?.upstream?.name === this.repository.HEAD?.upstream?.name &&
65+
this._HEAD?.upstream?.remote === this.repository.HEAD?.upstream?.remote &&
66+
this._HEAD?.upstream?.commit === this.repository.HEAD?.upstream?.commit) {
7167
return;
7268
}
7369

7470
this._HEAD = this.repository.HEAD;
7571

72+
// Check if HEAD supports incoming/outgoing (not a tag, not detached)
73+
if (!this._HEAD?.name || !this._HEAD?.commit || this._HEAD.type === RefType.Tag) {
74+
this.currentHistoryItemGroup = undefined;
75+
return;
76+
}
77+
7678
this.currentHistoryItemGroup = {
77-
id: `refs/heads/${this.repository.HEAD.name}`,
78-
label: this.repository.HEAD.name,
79-
upstream: this.repository.HEAD.upstream ?
79+
id: `refs/heads/${this._HEAD.name}`,
80+
label: this._HEAD.name,
81+
upstream: this._HEAD.upstream ?
8082
{
81-
id: `refs/remotes/${this.repository.HEAD.upstream.remote}/${this.repository.HEAD.upstream.name}`,
82-
label: `${this.repository.HEAD.upstream.remote}/${this.repository.HEAD.upstream.name}`,
83+
id: `refs/remotes/${this._HEAD.upstream.remote}/${this._HEAD.upstream.name}`,
84+
label: `${this._HEAD.upstream.remote}/${this._HEAD.upstream.name}`,
8385
} : undefined
8486
};
8587
}
@@ -115,7 +117,7 @@ export class GitHistoryProvider implements SourceControlHistoryProvider, FileDec
115117
description: commit.authorName,
116118
icon: new ThemeIcon('git-commit'),
117119
timestamp: commit.authorDate?.getTime(),
118-
statistics: commit.shortStat
120+
statistics: commit.shortStat ?? { files: 0, insertions: 0, deletions: 0 },
119121
};
120122
}));
121123

extensions/microsoft-authentication/src/AADHelper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ export class AzureActiveDirectoryService {
536536
scope: scopeData.scopeStr,
537537
sessionId,
538538
account: {
539-
label: claims.email ?? claims.preferred_username ?? claims.unique_name ?? '[email protected]',
539+
label: claims.preferred_username ?? claims.email ?? claims.unique_name ?? '[email protected]',
540540
id,
541541
type: claims.tid === MSA_TID || claims.tid === MSA_PASSTHRU_TID ? MicrosoftAccountType.MSA : MicrosoftAccountType.AAD
542542
}

extensions/typescript-language-features/src/languageFeatures/refactor.ts

Lines changed: 62 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import { nulToken } from '../utils/cancellation';
2121
import FormattingOptionsManager from './fileConfigurationManager';
2222
import { conditionalRegistration, requireSomeCapability } from './util/dependentRegistration';
2323
import { EditorChatFollowUp, EditorChatFollowUp_Args, CompositeCommand } from './util/copilot';
24+
import * as PConst from '../tsServer/protocol/protocol.const';
25+
import { CachedResponse } from '../tsServer/cachedResponse';
2426

2527
function toWorkspaceEdit(client: ITypeScriptServiceClient, edits: readonly Proto.FileCodeEdits[]): vscode.WorkspaceEdit {
2628
const workspaceEdit = new vscode.WorkspaceEdit();
@@ -455,8 +457,44 @@ type TsCodeAction = InlinedCodeAction | MoveToFileCodeAction | SelectCodeAction;
455457

456458
class TypeScriptRefactorProvider implements vscode.CodeActionProvider<TsCodeAction> {
457459

460+
private static readonly _declarationKinds = new Set([
461+
PConst.Kind.module,
462+
PConst.Kind.class,
463+
PConst.Kind.interface,
464+
PConst.Kind.function,
465+
PConst.Kind.enum,
466+
PConst.Kind.type,
467+
PConst.Kind.const,
468+
PConst.Kind.variable,
469+
PConst.Kind.let,
470+
]);
471+
472+
private static isOnSignatureName(node: Proto.NavigationTree, range: vscode.Range): boolean {
473+
if (this._declarationKinds.has(node.kind)) {
474+
// Show when on the name span
475+
if (node.nameSpan) {
476+
const convertedSpan = typeConverters.Range.fromTextSpan(node.nameSpan);
477+
if (range.intersection(convertedSpan)) {
478+
return true;
479+
}
480+
}
481+
482+
// Show when on the same line as an exported symbols without a name (handles default exports)
483+
if (!node.nameSpan && /\bexport\b/.test(node.kindModifiers) && node.spans.length) {
484+
const convertedSpan = typeConverters.Range.fromTextSpan(node.spans[0]);
485+
if (range.intersection(new vscode.Range(convertedSpan.start.line, 0, convertedSpan.start.line, Number.MAX_SAFE_INTEGER))) {
486+
return true;
487+
}
488+
}
489+
}
490+
491+
// Show if on the signature of any children
492+
return node.childItems?.some(child => this.isOnSignatureName(child, range)) ?? false;
493+
}
494+
458495
constructor(
459496
private readonly client: ITypeScriptServiceClient,
497+
private readonly cachedNavTree: CachedResponse<Proto.NavTreeResponse>,
460498
private readonly formattingOptionsManager: FormattingOptionsManager,
461499
commandManager: CommandManager,
462500
telemetryReporter: TelemetryReporter
@@ -516,20 +554,38 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider<TsCodeActi
516554
return undefined;
517555
}
518556

519-
const actions = Array.from(this.convertApplicableRefactors(document, response.body, rangeOrSelection)).filter(action => {
557+
const applicableRefactors = this.convertApplicableRefactors(document, response.body, rangeOrSelection);
558+
const actions = coalesce(await Promise.all(Array.from(applicableRefactors, async action => {
520559
if (this.client.apiVersion.lt(API.v430)) {
521560
// Don't show 'infer return type' refactoring unless it has been explicitly requested
522561
// https://github.com/microsoft/TypeScript/issues/42993
523562
if (!context.only && action.kind?.value === 'refactor.rewrite.function.returnType') {
524-
return false;
563+
return undefined;
564+
}
565+
}
566+
567+
// Don't include move actions on auto light bulb unless you are on a declaration name
568+
if (this.client.apiVersion.lt(API.v540) && context.triggerKind === vscode.CodeActionTriggerKind.Automatic) {
569+
if (action.kind?.value === Move_NewFile.kind.value || action.kind?.value === Move_File.kind.value) {
570+
const file = this.client.toOpenTsFilePath(document);
571+
if (!file) {
572+
return undefined;
573+
}
574+
575+
const navTree = await this.cachedNavTree.execute(document, () => this.client.execute('navtree', { file }, token));
576+
if (navTree.type !== 'response' || !navTree.body || !TypeScriptRefactorProvider.isOnSignatureName(navTree.body, rangeOrSelection)) {
577+
return undefined;
578+
}
525579
}
526580
}
527-
return true;
528-
});
581+
582+
return action;
583+
})));
529584

530585
if (!context.only) {
531586
return actions;
532587
}
588+
533589
return this.pruneInvalidActions(this.appendInvalidActions(actions), context.only, /* numberOfInvalid = */ 5);
534590
}
535591

@@ -719,6 +775,7 @@ class TypeScriptRefactorProvider implements vscode.CodeActionProvider<TsCodeActi
719775
export function register(
720776
selector: DocumentSelector,
721777
client: ITypeScriptServiceClient,
778+
cachedNavTree: CachedResponse<Proto.NavTreeResponse>,
722779
formattingOptionsManager: FormattingOptionsManager,
723780
commandManager: CommandManager,
724781
telemetryReporter: TelemetryReporter,
@@ -727,7 +784,7 @@ export function register(
727784
requireSomeCapability(client, ClientCapability.Semantic),
728785
], () => {
729786
return vscode.languages.registerCodeActionsProvider(selector.semantic,
730-
new TypeScriptRefactorProvider(client, formattingOptionsManager, commandManager, telemetryReporter),
787+
new TypeScriptRefactorProvider(client, cachedNavTree, formattingOptionsManager, commandManager, telemetryReporter),
731788
TypeScriptRefactorProvider.metadata);
732789
});
733790
}

extensions/typescript-language-features/src/languageProvider.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,17 @@ export default class LanguageProvider extends Disposable {
5757
private async registerProviders(): Promise<void> {
5858
const selector = this.documentSelector;
5959

60-
const cachedResponse = new CachedResponse();
60+
const cachedNavTreeResponse = new CachedResponse();
6161

6262
await Promise.all([
6363
import('./languageFeatures/callHierarchy').then(provider => this._register(provider.register(selector, this.client))),
64-
import('./languageFeatures/codeLens/implementationsCodeLens').then(provider => this._register(provider.register(selector, this.description, this.client, cachedResponse))),
65-
import('./languageFeatures/codeLens/referencesCodeLens').then(provider => this._register(provider.register(selector, this.description, this.client, cachedResponse))),
64+
import('./languageFeatures/codeLens/implementationsCodeLens').then(provider => this._register(provider.register(selector, this.description, this.client, cachedNavTreeResponse))),
65+
import('./languageFeatures/codeLens/referencesCodeLens').then(provider => this._register(provider.register(selector, this.description, this.client, cachedNavTreeResponse))),
6666
import('./languageFeatures/completions').then(provider => this._register(provider.register(selector, this.description, this.client, this.typingsStatus, this.fileConfigurationManager, this.commandManager, this.telemetryReporter, this.onCompletionAccepted))),
6767
import('./languageFeatures/definitions').then(provider => this._register(provider.register(selector, this.client))),
6868
import('./languageFeatures/directiveCommentCompletions').then(provider => this._register(provider.register(selector, this.client))),
6969
import('./languageFeatures/documentHighlight').then(provider => this._register(provider.register(selector, this.client))),
70-
import('./languageFeatures/documentSymbol').then(provider => this._register(provider.register(selector, this.client, cachedResponse))),
70+
import('./languageFeatures/documentSymbol').then(provider => this._register(provider.register(selector, this.client, cachedNavTreeResponse))),
7171
import('./languageFeatures/fileReferences').then(provider => this._register(provider.register(this.client, this.commandManager))),
7272
import('./languageFeatures/fixAll').then(provider => this._register(provider.register(selector, this.client, this.fileConfigurationManager, this.client.diagnosticsManager))),
7373
import('./languageFeatures/folding').then(provider => this._register(provider.register(selector, this.client))),
@@ -80,7 +80,7 @@ export default class LanguageProvider extends Disposable {
8080
import('./languageFeatures/mappedCodeEditProvider').then(provider => this._register(provider.register(selector, this.client))),
8181
import('./languageFeatures/organizeImports').then(provider => this._register(provider.register(selector, this.client, this.commandManager, this.fileConfigurationManager, this.telemetryReporter))),
8282
import('./languageFeatures/quickFix').then(provider => this._register(provider.register(selector, this.client, this.fileConfigurationManager, this.commandManager, this.client.diagnosticsManager, this.telemetryReporter))),
83-
import('./languageFeatures/refactor').then(provider => this._register(provider.register(selector, this.client, this.fileConfigurationManager, this.commandManager, this.telemetryReporter))),
83+
import('./languageFeatures/refactor').then(provider => this._register(provider.register(selector, this.client, cachedNavTreeResponse, this.fileConfigurationManager, this.commandManager, this.telemetryReporter))),
8484
import('./languageFeatures/references').then(provider => this._register(provider.register(selector, this.client))),
8585
import('./languageFeatures/rename').then(provider => this._register(provider.register(selector, this.description, this.client, this.fileConfigurationManager))),
8686
import('./languageFeatures/semanticTokens').then(provider => this._register(provider.register(selector, this.client))),

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "code-oss-dev",
33
"version": "1.85.0",
4-
"distro": "9c941fd7c7cf0d320ce7963afbd351a741fa468d",
4+
"distro": "244fe949c0c4aa2f05056992f4d0eee11cb12ab6",
55
"author": {
66
"name": "Microsoft Corporation"
77
},

product.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
},
5151
{
5252
"name": "ms-vscode.js-debug",
53-
"version": "1.84.0",
54-
"sha256": "a57691eb4440e549edba7472c0313e94f24d46ebe1ede18784b552fc5d11e596",
53+
"version": "1.85.0",
54+
"sha256": "85a97d373a6f92359f5db7bfc5a2fa6c5763b22c6ad07c962dfe32c84a079f3b",
5555
"repo": "https://github.com/microsoft/vscode-js-debug",
5656
"metadata": {
5757
"id": "25629058-ddac-4e17-abba-74678e126c5d",
@@ -66,8 +66,8 @@
6666
},
6767
{
6868
"name": "ms-vscode.vscode-js-profile-table",
69-
"version": "1.0.7",
70-
"sha256": "76924898456e45c1071a0ac4d31990bb740b689177665df915f3d39c7b767ba7",
69+
"version": "1.0.8",
70+
"sha256": "ca30069e21fbf576b49638ff8ff7c316b028c2faca924c23526737c65b8762bf",
7171
"repo": "https://github.com/microsoft/vscode-js-profile-visualizer",
7272
"metadata": {
7373
"id": "7e52b41b-71ad-457b-ab7e-0620f1fc4feb",

0 commit comments

Comments
 (0)