mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-25 14:20:30 -04:00
This reverts commit 5d44b6a6a7.
This commit is contained in:
@@ -197,11 +197,7 @@ function guessMimeTypeByFirstline(firstLine: string): string | null {
|
||||
}
|
||||
|
||||
if (firstLine.length > 0) {
|
||||
|
||||
// We want to prioritize associations based on the order they are registered so that the last registered
|
||||
// association wins over all other. This is for https://github.com/Microsoft/vscode/issues/20074
|
||||
for (let i = registeredAssociations.length - 1; i >= 0; i--) {
|
||||
const association = registeredAssociations[i];
|
||||
for (const association of registeredAssociations) {
|
||||
if (!association.firstline) {
|
||||
continue;
|
||||
}
|
||||
@@ -234,11 +230,10 @@ export function isUnspecific(mime: string[] | string): boolean {
|
||||
* 2. Otherwise, if there are other extensions, suggest the first one.
|
||||
* 3. Otherwise, suggest the prefix.
|
||||
*/
|
||||
export function suggestFilename(mode: string | undefined, prefix: string): string {
|
||||
export function suggestFilename(langId: string | null, prefix: string): string {
|
||||
const extensions = registeredAssociations
|
||||
.filter(assoc => !assoc.userConfigured && assoc.extension && assoc.id === mode)
|
||||
.filter(assoc => !assoc.userConfigured && assoc.extension && assoc.id === langId)
|
||||
.map(assoc => assoc.extension);
|
||||
|
||||
const extensionsWithDotFirst = coalesce(extensions)
|
||||
.filter(assoc => startsWith(assoc, '.'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user