Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
掘金者说
vscode
提交
70ee90dc
V
vscode
项目概览
掘金者说
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
70ee90dc
编写于
12月 22, 2015
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - move untitlededitorservice to common
上级
103d61e7
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
144 addition
and
116 deletion
+144
-116
src/vs/workbench/api/common/extHostDocuments.ts
src/vs/workbench/api/common/extHostDocuments.ts
+1
-1
src/vs/workbench/browser/parts/editor/untitledEditorInput.ts
src/vs/workbench/browser/parts/editor/untitledEditorInput.ts
+2
-2
src/vs/workbench/browser/workbench.ts
src/vs/workbench/browser/workbench.ts
+2
-1
src/vs/workbench/common/editor.ts
src/vs/workbench/common/editor.ts
+74
-56
src/vs/workbench/electron-browser/shell.ts
src/vs/workbench/electron-browser/shell.ts
+2
-1
src/vs/workbench/parts/files/browser/fileActions.ts
src/vs/workbench/parts/files/browser/fileActions.ts
+1
-1
src/vs/workbench/parts/files/browser/fileTracker.ts
src/vs/workbench/parts/files/browser/fileTracker.ts
+1
-1
src/vs/workbench/parts/files/browser/views/workingFilesViewer.ts
...workbench/parts/files/browser/views/workingFilesViewer.ts
+1
-1
src/vs/workbench/parts/files/browser/workingFilesModel.ts
src/vs/workbench/parts/files/browser/workingFilesModel.ts
+1
-1
src/vs/workbench/parts/files/electron-browser/electronFileTracker.ts
...bench/parts/files/electron-browser/electronFileTracker.ts
+1
-1
src/vs/workbench/parts/files/electron-browser/textFileServices.ts
...orkbench/parts/files/electron-browser/textFileServices.ts
+1
-1
src/vs/workbench/services/editor/browser/editorService.ts
src/vs/workbench/services/editor/browser/editorService.ts
+1
-1
src/vs/workbench/services/search/node/searchService.ts
src/vs/workbench/services/search/node/searchService.ts
+1
-1
src/vs/workbench/services/untitled/browser/untitledEditorService.ts
...kbench/services/untitled/browser/untitledEditorService.ts
+2
-45
src/vs/workbench/services/untitled/common/untitledEditorService.ts
...rkbench/services/untitled/common/untitledEditorService.ts
+50
-0
src/vs/workbench/test/browser/servicesTestUtils.ts
src/vs/workbench/test/browser/servicesTestUtils.ts
+3
-2
未找到文件。
src/vs/workbench/api/common/extHostDocuments.ts
浏览文件 @
70ee90dc
...
...
@@ -22,7 +22,7 @@ import {TPromise} from 'vs/base/common/winjs.base';
import
*
as
vscode
from
'
vscode
'
;
import
{
WordHelper
}
from
'
vs/editor/common/model/textModelWithTokensHelpers
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/
browser
/untitledEditorService
'
;
import
{
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/
common
/untitledEditorService
'
;
export
interface
IModelAddedData
{
url
:
URI
;
...
...
src/vs/workbench/browser/parts/editor/untitledEditorInput.ts
浏览文件 @
70ee90dc
...
...
@@ -10,7 +10,7 @@ import {IEditorModesRegistry, Extensions} from 'vs/editor/common/modes/modesRegi
import
{
isUnspecific
,
guessMimeTypes
,
MIME_TEXT
,
suggestFilename
}
from
'
vs/base/common/mime
'
;
import
labels
=
require
(
'
vs/base/common/labels
'
);
import
paths
=
require
(
'
vs/base/common/paths
'
);
import
{
EditorModel
,
EncodingMode
,
IInputStatus
,
EditorInput
,
IResourceEditorInput
,
IEncodingSupport
}
from
'
vs/workbench/common/editor
'
;
import
{
UntitledEditorInput
as
AbstractUntitledEditorInput
,
EditorModel
,
EncodingMode
,
IInputStatus
}
from
'
vs/workbench/common/editor
'
;
import
{
Registry
}
from
'
vs/platform/platform
'
;
import
{
UntitledEditorModel
}
from
'
vs/workbench/browser/parts/editor/untitledEditorModel
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
...
...
@@ -20,7 +20,7 @@ import {IWorkspaceContextService} from 'vs/platform/workspace/common/workspace';
/**
* An editor input to be used for untitled text buffers.
*/
export
class
UntitledEditorInput
extends
EditorInput
implements
IResourceEditorInput
,
IEncodingSuppor
t
{
export
class
UntitledEditorInput
extends
AbstractUntitledEditorInpu
t
{
public
static
ID
:
string
=
'
workbench.editors.untitledEditorInput
'
;
public
static
SCHEMA
:
string
=
'
untitled
'
;
...
...
src/vs/workbench/browser/workbench.ts
浏览文件 @
70ee90dc
...
...
@@ -36,7 +36,8 @@ import {IViewletRegistry, Extensions as ViewletExtensions} from 'vs/workbench/br
import
{
QuickOpenController
}
from
'
vs/workbench/browser/parts/quickopen/quickOpenController
'
;
import
{
getServices
}
from
'
vs/platform/instantiation/common/extensions
'
;
import
{
AbstractKeybindingService
}
from
'
vs/platform/keybinding/browser/keybindingServiceImpl
'
;
import
{
UntitledEditorService
,
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/browser/untitledEditorService
'
;
import
{
UntitledEditorService
}
from
'
vs/workbench/services/untitled/browser/untitledEditorService
'
;
import
{
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/common/untitledEditorService
'
;
import
{
WorkbenchEditorService
}
from
'
vs/workbench/services/editor/browser/editorService
'
;
import
{
Position
,
Parts
,
IPartService
}
from
'
vs/workbench/services/part/common/partService
'
;
import
{
DEFAULT_THEME_ID
}
from
'
vs/platform/theme/common/themes
'
;
...
...
src/vs/workbench/common/editor.ts
浏览文件 @
70ee90dc
...
...
@@ -122,6 +122,80 @@ export abstract class EditorInput extends EventEmitter implements IEditorInput {
}
}
export
interface
IResourceEditorInput
extends
IEditorInput
{
/**
* Gets the absolute file resource URI this input is about.
*/
getResource
():
URI
;
}
export
enum
EncodingMode
{
/**
* Instructs the encoding support to encode the current input with the provided encoding
*/
Encode
,
/**
* Instructs the encoding support to decode the current input with the provided encoding
*/
Decode
}
export
interface
IEncodingSupport
{
/**
* Gets the encoding of the input if known.
*/
getEncoding
():
string
;
/**
* Sets the encoding for the input for saving.
*/
setEncoding
(
encoding
:
string
,
mode
:
EncodingMode
):
void
;
}
/**
* This is a tagging interface to declare an editor input being capable of dealing with files. It is only used in the editor registry
* to register this kind of input to the platform.
*/
export
interface
IFileEditorInput
extends
IResourceEditorInput
,
IEncodingSupport
{
/**
* Gets the mime type of the file this input is about.
*/
getMime
():
string
;
/**
* Sets the mime type of the file this input is about.
*/
setMime
(
mime
:
string
):
void
;
/**
* Sets the absolute file resource URI this input is about.
*/
setResource
(
resource
:
URI
):
void
;
}
/**
* The base class of untitled editor inputs in the workbench.
*/
export
abstract
class
UntitledEditorInput
extends
EditorInput
implements
IResourceEditorInput
,
IEncodingSupport
{
abstract
getResource
():
URI
;
abstract
isDirty
():
boolean
;
abstract
suggestFileName
():
string
;
abstract
getMime
():
string
;
abstract
getEncoding
():
string
;
abstract
setEncoding
(
encoding
:
string
,
mode
:
EncodingMode
):
void
;
}
/**
* The base class of editor inputs that have an original and modified side.
*/
...
...
@@ -395,62 +469,6 @@ export class TextDiffEditorOptions extends TextEditorOptions {
public
autoRevealFirstChange
:
boolean
;
}
export
interface
IResourceEditorInput
extends
IEditorInput
{
/**
* Gets the absolute file resource URI this input is about.
*/
getResource
():
URI
;
}
export
enum
EncodingMode
{
/**
* Instructs the encoding support to encode the current input with the provided encoding
*/
Encode
,
/**
* Instructs the encoding support to decode the current input with the provided encoding
*/
Decode
}
export
interface
IEncodingSupport
{
/**
* Gets the encoding of the input if known.
*/
getEncoding
():
string
;
/**
* Sets the encoding for the input for saving.
*/
setEncoding
(
encoding
:
string
,
mode
:
EncodingMode
):
void
;
}
/**
* This is a tagging interface to declare an editor input being capable of dealing with files. It is only used in the editor registry
* to register this kind of input to the platform.
*/
export
interface
IFileEditorInput
extends
IResourceEditorInput
,
IEncodingSupport
{
/**
* Gets the mime type of the file this input is about.
*/
getMime
():
string
;
/**
* Sets the mime type of the file this input is about.
*/
setMime
(
mime
:
string
):
void
;
/**
* Sets the absolute file resource URI this input is about.
*/
setResource
(
resource
:
URI
):
void
;
}
/**
* Given an input, tries to get the associated URI for it (either file or untitled scheme).
*/
...
...
src/vs/workbench/electron-browser/shell.ts
浏览文件 @
70ee90dc
...
...
@@ -91,7 +91,8 @@ import {IWorkspaceContextService, IConfiguration, IWorkspace} from 'vs/platform/
import
{
IPluginService
}
from
'
vs/platform/plugins/common/plugins
'
;
import
{
MainThreadModeServiceImpl
}
from
'
vs/editor/common/services/modeServiceImpl
'
;
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
IUntitledEditorService
,
UntitledEditorService
}
from
'
vs/workbench/services/untitled/browser/untitledEditorService
'
;
import
{
UntitledEditorService
}
from
'
vs/workbench/services/untitled/browser/untitledEditorService
'
;
import
{
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/common/untitledEditorService
'
;
import
{
CrashReporter
}
from
'
vs/workbench/electron-browser/crashReporter
'
;
import
{
IThemeService
,
ThemeService
}
from
'
vs/workbench/services/themes/node/themeService
'
;
import
{
IServiceCtor
,
isServiceEvent
}
from
'
vs/base/common/service
'
;
...
...
src/vs/workbench/parts/files/browser/fileActions.ts
浏览文件 @
70ee90dc
...
...
@@ -39,7 +39,7 @@ import {HTMLFrameEditorInput} from 'vs/workbench/parts/files/browser/editors/htm
import
{
DerivedFrameEditorInput
}
from
'
vs/workbench/parts/files/browser/editors/derivedFrameEditorInput
'
;
import
{
IActionProvider
}
from
'
vs/base/parts/tree/browser/actionsRenderer
'
;
import
{
WorkingFileEntry
,
WorkingFilesModel
}
from
'
vs/workbench/parts/files/browser/workingFilesModel
'
;
import
{
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/
browser
/untitledEditorService
'
;
import
{
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/
common
/untitledEditorService
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IQuickOpenService
}
from
'
vs/workbench/services/quickopen/common/quickOpenService
'
;
import
{
IViewletService
}
from
'
vs/workbench/services/viewlet/common/viewletService
'
;
...
...
src/vs/workbench/parts/files/browser/fileTracker.ts
浏览文件 @
70ee90dc
...
...
@@ -21,7 +21,7 @@ import {DerivedFrameEditorInput} from 'vs/workbench/parts/files/browser/editors/
import
{
State
,
TextFileEditorModel
,
CACHE
}
from
'
vs/workbench/parts/files/browser/editors/textFileEditorModel
'
;
import
{
IFrameEditor
}
from
'
vs/workbench/browser/parts/editor/iframeEditor
'
;
import
{
EventType
as
WorkbenchEventType
,
EditorInputEvent
,
UntitledEditorEvent
}
from
'
vs/workbench/browser/events
'
;
import
{
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/
browser
/untitledEditorService
'
;
import
{
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/
common
/untitledEditorService
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IQuickOpenService
}
from
'
vs/workbench/services/quickopen/common/quickOpenService
'
;
import
{
IActivityService
,
NumberBadge
}
from
'
vs/workbench/services/activity/common/activityService
'
;
...
...
src/vs/workbench/parts/files/browser/views/workingFilesViewer.ts
浏览文件 @
70ee90dc
...
...
@@ -24,7 +24,7 @@ import {ContributableActionProvider} from 'vs/workbench/browser/actionBarRegistr
import
{
keybindingForAction
,
CloseWorkingFileAction
,
SelectResourceForCompareAction
,
CompareResourcesAction
,
SaveFileAsAction
,
SaveFileAction
,
RevertFileAction
,
OpenToSideAction
}
from
'
vs/workbench/parts/files/browser/fileActions
'
;
import
{
asFileResource
}
from
'
vs/workbench/parts/files/common/files
'
;
import
{
WorkingFileEntry
,
WorkingFilesModel
}
from
'
vs/workbench/parts/files/browser/workingFilesModel
'
;
import
{
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/
browser
/untitledEditorService
'
;
import
{
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/
common
/untitledEditorService
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IWorkspaceContextService
}
from
'
vs/workbench/services/workspace/common/contextService
'
;
import
{
IContextMenuService
}
from
'
vs/platform/contextview/browser/contextView
'
;
...
...
src/vs/workbench/parts/files/browser/workingFilesModel.ts
浏览文件 @
70ee90dc
...
...
@@ -14,7 +14,7 @@ import {disposeAll, IDisposable} from 'vs/base/common/lifecycle';
import
filesCommon
=
require
(
'
vs/workbench/parts/files/common/files
'
);
import
{
IFileStat
,
FileChangeType
,
FileChangesEvent
,
EventType
as
FileEventType
}
from
'
vs/platform/files/common/files
'
;
import
{
EditorEvent
,
UntitledEditorEvent
,
EventType
as
WorkbenchEventType
}
from
'
vs/workbench/browser/events
'
;
import
{
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/
browser
/untitledEditorService
'
;
import
{
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/
common
/untitledEditorService
'
;
import
{
IWorkbenchEditorService
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IPartService
}
from
'
vs/workbench/services/part/common/partService
'
;
import
{
IWorkspaceContextService
}
from
'
vs/workbench/services/workspace/common/contextService
'
;
...
...
src/vs/workbench/parts/files/electron-browser/electronFileTracker.ts
浏览文件 @
70ee90dc
...
...
@@ -13,7 +13,7 @@ import plat = require('vs/base/common/platform');
import
errors
=
require
(
'
vs/base/common/errors
'
);
import
URI
from
'
vs/base/common/uri
'
;
import
{
EventType
as
WorkbenchEventType
}
from
'
vs/workbench/browser/events
'
;
import
{
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/
browser
/untitledEditorService
'
;
import
{
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/
common
/untitledEditorService
'
;
import
{
IPartService
}
from
'
vs/workbench/services/part/common/partService
'
;
import
{
IWorkspaceContextService
}
from
'
vs/workbench/services/workspace/common/contextService
'
;
import
{
IResourceInput
}
from
'
vs/platform/editor/common/editor
'
;
...
...
src/vs/workbench/parts/files/electron-browser/textFileServices.ts
浏览文件 @
70ee90dc
...
...
@@ -20,7 +20,7 @@ import {CACHE, TextFileEditorModel} from 'vs/workbench/parts/files/browser/edito
import
{
ITextFileOperationResult
,
ConfirmResult
}
from
'
vs/workbench/parts/files/common/files
'
;
import
{
IWorkbenchActionRegistry
,
Extensions
as
ActionExtensions
}
from
'
vs/workbench/browser/actionRegistry
'
;
import
{
SyncActionDescriptor
}
from
'
vs/platform/actions/common/actions
'
;
import
{
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/
browser
/untitledEditorService
'
;
import
{
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/
common
/untitledEditorService
'
;
import
{
IFileService
}
from
'
vs/platform/files/common/files
'
;
import
{
IInstantiationService
,
INullService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IEventService
}
from
'
vs/platform/event/common/event
'
;
...
...
src/vs/workbench/services/editor/browser/editorService.ts
浏览文件 @
70ee90dc
...
...
@@ -16,7 +16,7 @@ import {BaseEditor, IEditorRegistry, Extensions} from 'vs/workbench/browser/part
import
{
EditorInput
,
EditorOptions
,
IFileEditorInput
,
TextEditorOptions
}
from
'
vs/workbench/common/editor
'
;
import
{
UntitledEditorInput
}
from
'
vs/workbench/browser/parts/editor/untitledEditorInput
'
;
import
{
DiffEditorInput
}
from
'
vs/workbench/browser/parts/editor/diffEditorInput
'
;
import
{
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/
browser
/untitledEditorService
'
;
import
{
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/
common
/untitledEditorService
'
;
import
{
IWorkbenchEditorService
,
EditorArrangement
,
IFileInput
}
from
'
vs/workbench/services/editor/common/editorService
'
;
import
{
IEditorInput
,
IEditorModel
,
IEditorOptions
,
Position
,
IEditor
,
IResourceInput
,
ITextEditorModel
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
...
...
src/vs/workbench/services/search/node/searchService.ts
浏览文件 @
70ee90dc
...
...
@@ -11,7 +11,7 @@ import objects = require('vs/base/common/objects');
import
filters
=
require
(
'
vs/base/common/filters
'
);
import
{
Client
}
from
'
vs/base/node/service.cp
'
;
import
{
IProgress
,
LineMatch
,
FileMatch
,
ISearchComplete
,
ISearchProgressItem
,
QueryType
,
IFileMatch
,
ISearchQuery
,
ISearchConfiguration
,
ISearchService
}
from
'
vs/platform/search/common/search
'
;
import
{
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/
browser
/untitledEditorService
'
;
import
{
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/
common
/untitledEditorService
'
;
import
{
IModelService
}
from
'
vs/editor/common/services/modelService
'
;
import
{
IWorkspaceContextService
}
from
'
vs/platform/workspace/common/workspace
'
;
import
{
IConfigurationService
}
from
'
vs/platform/configuration/common/configuration
'
;
...
...
src/vs/workbench/services/untitled/browser/untitledEditorService.ts
浏览文件 @
70ee90dc
...
...
@@ -8,51 +8,8 @@ import URI from 'vs/base/common/uri';
import
{
EventType
}
from
'
vs/base/common/events
'
;
import
arrays
=
require
(
'
vs/base/common/arrays
'
);
import
{
UntitledEditorInput
}
from
'
vs/workbench/browser/parts/editor/untitledEditorInput
'
;
import
{
IInstantiationService
,
ServiceIdentifier
,
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
export
interface
IUntitledEditorServices
{
untitledEditorService
?:
IUntitledEditorService
;
}
export
var
IUntitledEditorService
=
createDecorator
<
IUntitledEditorService
>
(
'
untitledEditorService
'
);
export
interface
IUntitledEditorService
{
serviceId
:
ServiceIdentifier
<
any
>
;
/**
* Returns the untitled editor input matching the provided resource.
*/
get
(
resource
:
URI
):
UntitledEditorInput
;
/**
* Returns all untitled editor inputs.
*/
getAll
(
resources
?:
URI
[]):
UntitledEditorInput
[];
/**
* Returns dirty untitled editors as resource URIs.
*/
getDirty
():
URI
[];
/**
* Returns true iff the provided resource is dirty.
*/
isDirty
(
resource
:
URI
):
boolean
;
/**
* Creates a new untitled input with the optional resource URI or returns an existing one
* if the provided resource exists already as untitled input.
*
* It is valid to pass in a file resource. In that case the path will be used as identifier.
* The use case is to be able to create a new file with a specific path with VSCode.
*/
createOrGet
(
resource
?:
URI
,
modeId
?:
string
):
UntitledEditorInput
;
/**
* A check to find out if a untitled resource has a file path associated or not.
*/
hasAssociatedFilePath
(
resource
:
URI
):
boolean
;
}
import
{
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/common/untitledEditorService
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
export
class
UntitledEditorService
implements
IUntitledEditorService
{
public
serviceId
=
IUntitledEditorService
;
...
...
src/vs/workbench/services/untitled/common/untitledEditorService.ts
0 → 100644
浏览文件 @
70ee90dc
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'
use strict
'
;
import
URI
from
'
vs/base/common/uri
'
;
import
{
UntitledEditorInput
}
from
'
vs/workbench/common/editor
'
;
import
{
ServiceIdentifier
,
createDecorator
}
from
'
vs/platform/instantiation/common/instantiation
'
;
export
var
IUntitledEditorService
=
createDecorator
<
IUntitledEditorService
>
(
'
untitledEditorService
'
);
export
interface
IUntitledEditorService
{
serviceId
:
ServiceIdentifier
<
any
>
;
/**
* Returns the untitled editor input matching the provided resource.
*/
get
(
resource
:
URI
):
UntitledEditorInput
;
/**
* Returns all untitled editor inputs.
*/
getAll
(
resources
?:
URI
[]):
UntitledEditorInput
[];
/**
* Returns dirty untitled editors as resource URIs.
*/
getDirty
():
URI
[];
/**
* Returns true iff the provided resource is dirty.
*/
isDirty
(
resource
:
URI
):
boolean
;
/**
* Creates a new untitled input with the optional resource URI or returns an existing one
* if the provided resource exists already as untitled input.
*
* It is valid to pass in a file resource. In that case the path will be used as identifier.
* The use case is to be able to create a new file with a specific path with VSCode.
*/
createOrGet
(
resource
?:
URI
,
modeId
?:
string
):
UntitledEditorInput
;
/**
* A check to find out if a untitled resource has a file path associated or not.
*/
hasAssociatedFilePath
(
resource
:
URI
):
boolean
;
}
\ No newline at end of file
src/vs/workbench/test/browser/servicesTestUtils.ts
浏览文件 @
70ee90dc
...
...
@@ -41,6 +41,7 @@ import {BaseWorkspaceContextService} from 'vs/platform/workspace/common/baseWork
import
{
IEditorInput
,
IEditorModel
,
IEditorOptions
,
ITextInput
,
Position
,
IEditor
,
IResourceInput
,
ITextEditorModel
}
from
'
vs/platform/editor/common/editor
'
;
import
{
IEventService
}
from
'
vs/platform/event/common/event
'
;
import
{
IInstantiationService
}
from
'
vs/platform/instantiation/common/instantiation
'
;
import
{
IUntitledEditorService
}
from
'
vs/workbench/services/untitled/common/untitledEditorService
'
;
import
{
IMessageService
,
IConfirmation
}
from
'
vs/platform/message/common/message
'
;
import
Lifecycle
=
require
(
'
vs/base/common/lifecycle
'
);
import
{
IRequestService
}
from
'
vs/platform/request/common/request
'
;
...
...
@@ -355,8 +356,8 @@ export class MockRequestService extends BaseRequestService {
}
}
export
class
TestUntitledEditorService
implements
UntitledEditorService
.
IUntitledEditorService
{
public
serviceId
=
UntitledEditorService
.
IUntitledEditorService
;
export
class
TestUntitledEditorService
implements
IUntitledEditorService
{
public
serviceId
=
IUntitledEditorService
;
public
get
(
resource
:
URI
)
{
return
null
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录