Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
4f759fc2
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
4f759fc2
编写于
10月 27, 2020
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
proxy auth - use urlProtocol as partition
上级
e5c0007c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
31 addition
and
25 deletion
+31
-25
src/vs/code/electron-main/auth2.ts
src/vs/code/electron-main/auth2.ts
+2
-1
src/vs/platform/windows/electron-main/windowsMainService.ts
src/vs/platform/windows/electron-main/windowsMainService.ts
+29
-24
未找到文件。
src/vs/code/electron-main/auth2.ts
浏览文件 @
4f759fc2
...
...
@@ -11,6 +11,7 @@ import { IWindowsMainService } from 'vs/platform/windows/electron-main/windows';
import
{
INativeHostMainService
}
from
'
vs/platform/native/electron-main/nativeHostMainService
'
;
import
{
IEncryptionMainService
}
from
'
vs/platform/encryption/electron-main/encryptionMainService
'
;
import
{
generateUuid
}
from
'
vs/base/common/uuid
'
;
import
product
from
'
vs/platform/product/common/product
'
;
type
LoginEvent
=
{
event
:
ElectronEvent
;
...
...
@@ -26,7 +27,7 @@ type Credentials = {
export
class
ProxyAuthHandler2
extends
Disposable
{
private
static
PROXY_CREDENTIALS_SERVICE_KEY
=
'
vscode.proxy-credentials
'
;
private
static
PROXY_CREDENTIALS_SERVICE_KEY
=
`
${
product
.
urlProtocol
}
.proxy-credentials`
;
private
pendingProxyHandler
=
false
;
private
proxyDialogShown
=
false
;
...
...
src/vs/platform/windows/electron-main/windowsMainService.ts
浏览文件 @
4f759fc2
...
...
@@ -395,7 +395,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
const
emptyToRestore
:
IEmptyWindowBackupInfo
[]
=
[];
// empty windows with backupPath
let
emptyToOpen
:
number
=
0
;
let
fileInputs
:
IFileInputs
|
undefined
;
// collect all file inputs
let
fileInputs
:
IFileInputs
|
undefined
;
// collect all file inputs
for
(
const
path
of
pathsToOpen
)
{
if
(
isFolderPathToOpen
(
path
))
{
if
(
openConfig
.
addMode
)
{
...
...
@@ -504,6 +504,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
recents
.
push
({
label
:
pathToOpen
.
label
,
fileUri
:
pathToOpen
.
fileUri
});
}
}
this
.
workspacesHistoryMainService
.
addRecentlyOpened
(
recents
);
}
...
...
@@ -767,7 +768,6 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
window
.
focus
();
// make sure window has focus
const
request
:
IAddFoldersRequest
=
{
foldersToAdd
};
window
.
sendWhenReady
(
'
vscode:addFolders
'
,
request
);
return
window
;
...
...
@@ -1098,7 +1098,8 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
return
undefined
;
}
let
lineNumber
,
columnNumber
:
number
|
undefined
;
let
lineNumber
:
number
|
undefined
;
let
columnNumber
:
number
|
undefined
;
if
(
options
.
gotoLineMode
)
{
const
parsedPath
=
parseLineAndColumnAware
(
anyPath
);
...
...
@@ -1110,7 +1111,6 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
// open remote if either specified in the cli even if it is a local file.
const
remoteAuthority
=
options
.
remoteAuthority
;
if
(
remoteAuthority
)
{
const
first
=
anyPath
.
charCodeAt
(
0
);
...
...
@@ -1119,7 +1119,8 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
if
(
isWindowsDriveLetter
(
first
)
&&
anyPath
.
charCodeAt
(
anyPath
.
charCodeAt
(
1
))
===
CharCode
.
Colon
)
{
anyPath
=
toSlashes
(
anyPath
);
}
anyPath
=
'
/
'
+
anyPath
;
anyPath
=
`/
${
anyPath
}
`
;
}
const
uri
=
URI
.
from
({
scheme
:
Schemas
.
vscodeRemote
,
authority
:
remoteAuthority
,
path
:
anyPath
});
...
...
@@ -1134,13 +1135,13 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
return
{
fileUri
:
uri
,
remoteAuthority
};
}
}
return
{
folderUri
:
uri
,
remoteAuthority
};
}
let
candidate
=
normalize
(
anyPath
);
try
{
const
candidateStat
=
fs
.
statSync
(
candidate
);
if
(
candidateStat
.
isFile
())
{
...
...
@@ -1247,6 +1248,7 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
return
[
existingWindow
];
}
let
folderUris
=
openConfig
.
cli
[
'
folder-uri
'
]
||
[];
let
fileUris
=
openConfig
.
cli
[
'
file-uri
'
]
||
[];
let
cliArgs
=
openConfig
.
cli
.
_
;
...
...
@@ -1297,23 +1299,26 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
if
(
!!
findWindowOnWorkspaceOrFolderUri
(
WindowsMainService
.
WINDOWS
,
uri
))
{
return
false
;
}
return
uri
.
authority
===
authority
;
});
folderUris
=
folderUris
.
filter
(
uri
=>
{
const
u
=
this
.
argToUri
(
uri
);
if
(
!!
findWindowOnWorkspaceOrFolderUri
(
WindowsMainService
.
WINDOWS
,
u
))
{
folderUris
=
folderUris
.
filter
(
folderUriStr
=>
{
const
folderUri
=
this
.
argToUri
(
folderUriStr
);
if
(
!!
findWindowOnWorkspaceOrFolderUri
(
WindowsMainService
.
WINDOWS
,
folderUri
))
{
return
false
;
}
return
u
?
u
.
authority
===
authority
:
false
;
return
folderUri
?
folderUri
.
authority
===
authority
:
false
;
});
fileUris
=
fileUris
.
filter
(
uri
=>
{
const
u
=
this
.
argToUri
(
uri
);
if
(
!!
findWindowOnWorkspaceOrFolderUri
(
WindowsMainService
.
WINDOWS
,
u
))
{
fileUris
=
fileUris
.
filter
(
fileUriStr
=>
{
const
fileUri
=
this
.
argToUri
(
fileUriStr
);
if
(
!!
findWindowOnWorkspaceOrFolderUri
(
WindowsMainService
.
WINDOWS
,
fileUri
))
{
return
false
;
}
return
u
?
u
.
authority
===
authority
:
false
;
return
fileUri
?
fileUri
.
authority
===
authority
:
false
;
});
openConfig
.
cli
.
_
=
cliArgs
;
...
...
@@ -1623,6 +1628,16 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
return
state
;
}
private
onWindowClosed
(
win
:
ICodeWindow
):
void
{
// Remove from our list so that Electron can clean it up
const
index
=
WindowsMainService
.
WINDOWS
.
indexOf
(
win
);
WindowsMainService
.
WINDOWS
.
splice
(
index
,
1
);
// Emit
this
.
_onWindowsCountChanged
.
fire
({
oldCount
:
WindowsMainService
.
WINDOWS
.
length
+
1
,
newCount
:
WindowsMainService
.
WINDOWS
.
length
});
}
getLastActiveWindow
():
ICodeWindow
|
undefined
{
return
getLastActiveWindow
(
WindowsMainService
.
WINDOWS
);
}
...
...
@@ -1680,14 +1695,4 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
getWindowCount
():
number
{
return
WindowsMainService
.
WINDOWS
.
length
;
}
private
onWindowClosed
(
win
:
ICodeWindow
):
void
{
// Remove from our list so that Electron can clean it up
const
index
=
WindowsMainService
.
WINDOWS
.
indexOf
(
win
);
WindowsMainService
.
WINDOWS
.
splice
(
index
,
1
);
// Emit
this
.
_onWindowsCountChanged
.
fire
({
oldCount
:
WindowsMainService
.
WINDOWS
.
length
+
1
,
newCount
:
WindowsMainService
.
WINDOWS
.
length
});
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录