Skip to content

Commit

Permalink
Fix #47748
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 committed Apr 17, 2018
1 parent 6705b91 commit 523abdc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/vs/editor/common/services/resourceConfigurationImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { ITextResourceConfigurationService } from 'vs/editor/common/services/res
import { IPosition, Position } from 'vs/editor/common/core/position';
import { IModeService } from 'vs/editor/common/services/modeService';
import { IModelService } from 'vs/editor/common/services/modelService';
import { basename } from 'vs/base/common/paths';

export class TextResourceConfigurationService extends Disposable implements ITextResourceConfigurationService {

Expand Down Expand Up @@ -42,6 +43,6 @@ export class TextResourceConfigurationService extends Disposable implements ITex
if (model) {
return position ? this.modeService.getLanguageIdentifier(model.getLanguageIdAtPosition(position.lineNumber, position.column)).language : model.getLanguageIdentifier().language;
}
return this.modeService.getModeIdByFilenameOrFirstLine(resource.fsPath);
return this.modeService.getModeIdByFilenameOrFirstLine(basename(resource.path));
}
}

0 comments on commit 523abdc

Please sign in to comment.