字符串无法在vscode API中的URI中解析

时间:2016-09-17 18:01:16

标签: node.js typescript visual-studio-code vscode-extensions

控制台日志显示:\ Users \ skhan \ Library \ Application Support \ Code \ User \ summary.txt

as循环用于替换斜杠

它在windows中工作正常但在ubuntu和mac中不起作用,这是OSX 10.11.6的例子

但是当我尝试使用API​​解析URI时,我得到以下错误

  

threadService.ts:217 [Extension Host]无法打开无标题:%5CUsers%5Cjdoe%5CLibrary%5CApplication%20Support%5CCode%5CUser%5Csummary.txt。详细信息:预期URI无标题:%5CUsers%5Cjdoet%5CLibrary%5CApplication%20Support%5CCode%5CUser%5Csummary.txt但GOT无标题:/Users/jdoe/Library/Application%20Support/Code/User/summary.txt(匿名函数) @ threadService.ts:217

以下是代码

```

while (tempURI.indexOf("/") > -1) {
            tempURI = tempURI.replace("/", "\\");
        }

        console.log("FILE URI For Summary Page : " + tempURI);

        var setting: vscode.Uri = vscode.Uri.parse("untitled:" + tempURI); //ERROR HERE

        vscode.workspace.openTextDocument(setting).then((a: vscode.TextDocument) => { ...

```

有没有更多我要做的解析正确的URI?

1 个答案:

答案 0 :(得分:0)

我使用-keep public class com.google.android.gms.* { public *; } -dontwarn com.google.android.gms.** 制作文件,所有内容都按预期工作