Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"window.showTextDocument" Does Not open Resources With "untitled" Scheme #6565

Closed
TomHermanSAP opened this issue Nov 17, 2019 · 11 comments · Fixed by #6803
Closed

"window.showTextDocument" Does Not open Resources With "untitled" Scheme #6565

TomHermanSAP opened this issue Nov 17, 2019 · 11 comments · Fixed by #6803
Assignees
Labels
bug bugs found in the application help wanted issues meant to be picked up, require help vscode issues related to VSCode compatibility

Comments

@TomHermanSAP
Copy link

Description

Using SQLTools extension (0.21.3), https://marketplace.visualstudio.com/items?itemName=mtxr.sqltools.
When trying to connect to a db at the first time, SQLite dependency is installed.
The dependency can be installed automatically if using in User preferences:

"sqltools.dependencyManager": {
        "autoAccept": true
    }

Based on https://github.com/mtxr/vscode-sqltools/releases/tag/v0.21.2.

In vscode no error apears, yet in gitprod the following error notification appears:
SQLTools - Error installing dependency SQLite

Reproduction Steps

  1. Download SQLTools extension (current version 0.21.3)
  2. Create in workspace/theia a new file called "tom.db".
  3. Add to User preferences the following values:
{
    "sqltools.useNodeRuntime": true,
    "sqltools.dependencyManager": {
        "autoAccept": true
    },
    "sqltools.connections": [
        {
            "name": "sqlite",
            "dialect": "SQLite",
            "database": "workspace/theia/tom.db"
        }
    ]
}

image

  1. Click on SQLTools extension. In "sqlite" linem, click on connect:
    image

  2. Expect the error notification displayed in the Description section to appear.

OS and Theia version:

Diagnostics:
SQLTools - Error installing dependency SQLite
SQLTools - Error installing dependency SQLite - Log Info

@akosyakov akosyakov added bug bugs found in the application help wanted issues meant to be picked up, require help vscode issues related to VSCode compatibility labels Nov 18, 2019
@akosyakov
Copy link
Member

It would be helpful if someone investigates what is missing.

@amiramw
Copy link
Member

amiramw commented Dec 2, 2019

@TomHermanSAP and me are investigating.

@amiramw
Copy link
Member

amiramw commented Dec 5, 2019

I think we found the gap.

This is a minimal code that reproduce it:

const uri = vscode.Uri.file(os.homedir + '/newnew.txt');
const fileUri = vscode.Uri.parse(`untitled:${uri}`).with({ scheme: 'untitled' });
vscode.window.showTextDocument(fileUri);

We tried it with hosted theia. The editor doesn't open and we get this error on theia:

root ERROR [hosted-plugin: 9850] Promise rejection not handled in one second: Error: TypeError: Cannot read property 'dispose' of undefined
root ERROR [hosted-plugin: 9850] With stack trace: Error: TypeError: Cannot read property 'dispose' of undefined
    at e.<anonymous> (https://webide-workspaces-ws-qwkth-app5.cry10.int.webide.cloud.sap/bundle.js:19:785104)
    at https://webide-workspaces-ws-qwkth-app5.cry10.int.webide.cloud.sap/bundle.js:19:781329
    at Object.throw (https://webide-workspaces-ws-qwkth-app5.cry10.int.webide.cloud.sap/bundle.js:19:781434)
    at s (https://webide-workspaces-ws-qwkth-app5.cry10.int.webide.cloud.sap/bundle.js:19:780231)

On VS Code this code opens a new tab with unsaved document newnew.txt.

@TomHermanSAP
Copy link
Author

TomHermanSAP commented Dec 8, 2019

Seems like "untitled" scheme does not have a "ResourceResolver", for example as File Resource has:
https://github.com/eclipse-theia/theia/blob/master/packages/filesystem/src/browser/file-resource.ts#L143

@offer8
Copy link

offer8 commented Dec 16, 2019

Do you know why the untitled file created by this method: "createUntitledResource"

export function createUntitledResource(content?: string, language?: string): UntitledResource {

is read-only one?

@TomHermanSAP TomHermanSAP changed the title [SQLTools Extension] Error Notification While Installing Dependencies "window.showTextDocument" Does Not open Resources With "untitled" Scheme Dec 16, 2019
@offer8
Copy link

offer8 commented Dec 17, 2019

@akosyakov after investigation, there seems to be 2 options to proceed:

  1. "UntitledResourceResolver" - add support to create files in file systems
  2. Direct 'untitled' schema typed files to be resolved by the "FileResourceResolver" somehow.
    We tried and currently it cannot find files because it is concatenating 'untitiled' to file url, as seen here:
root ERROR [hosted-plugin: 18608] With stack trace: Error: Error: 'untitled:file%3A///c%3A/Users/sss/newnew.txt' has not been found.
    at DocumentsMainImpl.<anonymous> (http://localhost:3000/47.bundle.js:338:31)
    at step (http://localhost:3000/47.bundle.js:153:23)
    at Object.throw (http://localhost:3000/47.bundle.js:134:53)
    at rejected (http://localhost:3000/47.bundle.js:126:65)

Do you have a proposal how to continue?

@akosyakov
Copy link
Member

akosyakov commented Dec 18, 2019

"UntitledResourceResolver" - add support to create files in file systems

@offer8 Can it be implemented by delegating to FileResourceResolver? i.e. whenever saveContents is called a user is prompted to save a file and then an instance of FileResource is created, to which UntitledResource delegates all calls

ShimonBenYair added a commit to ShimonBenYair/theia that referenced this issue Dec 30, 2019
Fixes eclipse-theia#6565

Signed-off-by: Shimon Ben Yair <shimon.ben.yair@sap.com>
@akosyakov
Copy link
Member

@amiramw @TomHermanSAP @offer8 Could you test #6803 please?

ShimonBenYair added a commit to ShimonBenYair/theia that referenced this issue Jan 2, 2020
Fixes eclipse-theia#6565

Signed-off-by: Shimon Ben Yair <shimon.ben.yair@sap.com>
ShimonBenYair added a commit to ShimonBenYair/theia that referenced this issue Jan 15, 2020
Fixes eclipse-theia#6565

Signed-off-by: Shimon Ben Yair <shimon.ben.yair@sap.com>
ShimonBenYair added a commit to ShimonBenYair/theia that referenced this issue Jan 16, 2020
Fixes eclipse-theia#6565

Signed-off-by: Shimon Ben Yair <shimon.ben.yair@sap.com>
ShimonBenYair added a commit to ShimonBenYair/theia that referenced this issue Jan 22, 2020
Fixes eclipse-theia#6565

Signed-off-by: Shimon Ben Yair <shimon.ben.yair@sap.com>
ShimonBenYair added a commit to ShimonBenYair/theia that referenced this issue Jan 22, 2020
Fixes eclipse-theia#6565

Signed-off-by: Shimon Ben Yair <shimon.ben.yair@sap.com>
ShimonBenYair added a commit to ShimonBenYair/theia that referenced this issue Jan 26, 2020
Fixes eclipse-theia#6565

Signed-off-by: Shimon Ben Yair <shimon.ben.yair@sap.com>
ShimonBenYair added a commit to ShimonBenYair/theia that referenced this issue Feb 11, 2020
Fixes eclipse-theia#6565

Signed-off-by: Shimon Ben Yair <shimon.ben.yair@sap.com>
ShimonBenYair added a commit to ShimonBenYair/theia that referenced this issue Feb 11, 2020
Fixes eclipse-theia#6565

Signed-off-by: Shimon Ben Yair <shimon.ben.yair@sap.com>
ShimonBenYair added a commit to ShimonBenYair/theia that referenced this issue Feb 11, 2020
Fixes eclipse-theia#6565

Signed-off-by: Shimon Ben Yair <shimon.ben.yair@sap.com>
ShimonBenYair added a commit to ShimonBenYair/theia that referenced this issue Feb 11, 2020
Fixes eclipse-theia#6565

Signed-off-by: Shimon Ben Yair <shimon.ben.yair@sap.com>
ShimonBenYair added a commit to ShimonBenYair/theia that referenced this issue Feb 13, 2020
Fixes eclipse-theia#6565

Signed-off-by: Shimon Ben Yair <shimon.ben.yair@sap.com>
ShimonBenYair added a commit to ShimonBenYair/theia that referenced this issue Feb 16, 2020
Fixes eclipse-theia#6565

Signed-off-by: Shimon Ben Yair <shimon.ben.yair@sap.com>
ShimonBenYair added a commit to ShimonBenYair/theia that referenced this issue Feb 18, 2020
Fixes eclipse-theia#6565

Signed-off-by: Shimon Ben Yair <shimon.ben.yair@sap.com>
ShimonBenYair added a commit to ShimonBenYair/theia that referenced this issue Feb 18, 2020
Fixes eclipse-theia#6565

Signed-off-by: Shimon Ben Yair <shimon.ben.yair@sap.com>
ShimonBenYair added a commit to ShimonBenYair/theia that referenced this issue Feb 19, 2020
Fixes eclipse-theia#6565

Signed-off-by: Shimon Ben Yair <shimon.ben.yair@sap.com>
ShimonBenYair added a commit to ShimonBenYair/theia that referenced this issue Feb 21, 2020
Fixes eclipse-theia#6565

Signed-off-by: Shimon Ben Yair <shimon.ben.yair@sap.com>
ShimonBenYair added a commit to ShimonBenYair/theia that referenced this issue Feb 22, 2020
Fixes eclipse-theia#6565

Signed-off-by: Shimon Ben Yair <shimon.ben.yair@sap.com>
ShimonBenYair added a commit to ShimonBenYair/theia that referenced this issue Feb 24, 2020
Fixes eclipse-theia#6565

Signed-off-by: Shimon Ben Yair <shimon.ben.yair@sap.com>
akosyakov pushed a commit that referenced this issue Feb 24, 2020
Fixes #6565

Signed-off-by: Shimon Ben Yair <shimon.ben.yair@sap.com>
@offer8
Copy link

offer8 commented Feb 24, 2020

@akosyakov can this one be part of v0.16.0 release?

@amiramw
Copy link
Member

amiramw commented Feb 24, 2020

it's in the master and 0.16.0 was not released yet so why not?

JesterOrNot pushed a commit to JesterOrNot/theia that referenced this issue Mar 12, 2020
Fixes eclipse-theia#6565

Signed-off-by: Shimon Ben Yair <shimon.ben.yair@sap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application help wanted issues meant to be picked up, require help vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants