GithubHelp home page GithubHelp logo

Comments (30)

brakmic avatar brakmic commented on June 17, 2024

Well, I think I've found the issue: it was a problem with the path in my etc.d.ts

I use one "references repo" for all the files I reference throughout my project (etc.d.ts). And the reference to the file which was throwing the error was not accurate.

Now, I get the code completion. 😅

from arctictypescript.

brakmic avatar brakmic commented on June 17, 2024

Unfortunately, it still throws the same error as soon as I create a new TS-file. 😭

from arctictypescript.

Phaiax avatar Phaiax commented on June 17, 2024

Are you using windows or linux?

from arctictypescript.

brakmic avatar brakmic commented on June 17, 2024

Windows.

from arctictypescript.

pocesar avatar pocesar commented on June 17, 2024

literally just bumped into this problem, using windows as well, using TSS 0.3.1

completion json error :  "TSS command processing error: TypeError: Cannot read property 'lineMap' of undefined"

inside any .ts file, if I press the auto complete / hint shortcut, it appears on the console

tsconfig.json:

{
    "compilerOptions" : {
        "target" : "es5",
        "module" : "commonjs"
    }
}

.sublimets:

{
  "root": "./reference.d.ts"
}

reference.d.ts:

/// <reference path="./typings/generic.d.ts" />

//grunt-start
//grunt-end

typings/generic.d.ts:

/// <reference path="./tsd.d.ts" />
/* ... */

typings/tsd.d.ts:

/// <reference path="./jquery/jquery.d.ts" />
/// <reference path="./angularjs/angular.d.ts" />
/// <reference path="./node/node.d.ts" />
/// <reference path="./lodash/lodash.d.ts" />
/// <reference path="./modernizr/modernizr.d.ts" />
/// <reference path="./angular-ui/angular-ui-router.d.ts" />
/// <reference path="./angular-ui-bootstrap/angular-ui-bootstrap.d.ts" />
/// <reference path="./bluebird/bluebird.d.ts" />
/// <reference path="./restangular/restangular.d.ts" />
/// <reference path="./object-path/object-path.d.ts" />
/// <reference path="./phery/phery.d.ts" />

from arctictypescript.

Phaiax avatar Phaiax commented on June 17, 2024

Hm.

The thing is. I have done a lot of changes (completely replaced .sublimets and project config with tsconfig.json and updated everything), but there is still an encoding issue with the interprocess I/O on windows.

I have tracked down the issue to this encoding stuff a few hours ago, but I still need to figure out what exactly is happening there.

If you would use linux I would suggest to switch to the new branch, but since you are on windows, you have to be patient, I'm sorry.

If this bug still exists with the new version, I will care about it, but now I don't know exactly why this is happening and I can not provide a quick fix / workaround.

from arctictypescript.

brakmic avatar brakmic commented on June 17, 2024

I'll wait for the remedy 😄

Thanks!
👍

from arctictypescript.

pocesar avatar pocesar commented on June 17, 2024

is there anyway I can enable a debug / verbose output to the console, so I can help you track it down more effectively? I have no python knowlege, but can help with the JS part though (cross platform)

from arctictypescript.

Phaiax avatar Phaiax commented on June 17, 2024

I found the error. It was related to a filename upper/lowercase mismatch on windows.

Version 0.6.0 has been released. (it may take a while until https://packagecontrol.io/ has updated)

Please report if this problem persists.

from arctictypescript.

pocesar avatar pocesar commented on June 17, 2024
ArcticTypescript: error   : Completion request failed: "TSS command processing error: Error: Could not find file: 'g:/www/marcos/javascripts/app/main.ts'."

ArcticTypescript: error   : Internal ArcticTypescript error during show_errors: "TSS command processing error: Error: Could not find file: 'g:/www/marcos/javascripts/app/main.ts'."
 (Exception Message: tss.js internal error: "TSS command processing error: Error: Could not find file: 'g:/www/marcos/javascripts/app/main.ts'."
)

This happen when I type anything inside a .ts file

contents of javascripts/app/main.ts:

// G:\www\marcos>cat g:/www/marcos/javascripts/app/main.ts
import Index = require('./sections/index');
import Plans = require('./sections/plans');

module Main {
    'use strict';

    angular
    .module('Main', [
        'Index',
        'Plans'
    ]);
}

export = Main;

tsconfig.json:

{
    "compilerOptions" : {
        "target" : "es5",
        "module" : "commonjs"
    },
    "files": [
        "reference.d.ts"
    ]
}

from arctictypescript.

brakmic avatar brakmic commented on June 17, 2024

Same problems here. I suppose because of lower-casing (all paths are lowercase which is very unusual when working under Windows).

from arctictypescript.

brakmic avatar brakmic commented on June 17, 2024

And in some other TS-file I get completion but one that contains all possible values (from other libraries like jQuery, Underscore, knockout etc.)

from arctictypescript.

Phaiax avatar Phaiax commented on June 17, 2024

Hey. I think this is an error many people may experience, so I have written the solution into the wiki.

Best behaviour of ArcticTypescript would be to notify the user about the missing entry or even support him in adding the missing file, but this is not a major issue i think.

https://github.com/Phaiax/ArcticTypescript/wiki/Common-Errors-and-Solutions

Is the problem resolved if you ad the missing file and reopen the project?

from arctictypescript.

brakmic avatar brakmic commented on June 17, 2024

Hi,

Yes the code completion is there, in all TS-files but it's not like the "normal" one, because the amount of possible selections is really long. I'd say that now the completion is not "context sensitive" anymore. For example, if I have a class with only a property called "name" the completion in the class' constructor shows not only "name" as option but everything else it "knows".

I'm not sure if there's a problem from my side and how I can help to minimize the amount of possible selections.

Thanks for your work & help! 👍

from arctictypescript.

Phaiax avatar Phaiax commented on June 17, 2024

If i press ctrl + space in an empty row in the class constructor, i get the very long list.

But if i type this., I will only get the class members.

I think this should be the correct behaviour, as you can do many things in an empty line.

Does this match your observations? :D

from arctictypescript.

brakmic avatar brakmic commented on June 17, 2024

I always get the same long list. 😢

from arctictypescript.

Phaiax avatar Phaiax commented on June 17, 2024

Can you provide a minimal code example? Maybe this helps with reproducing the failure.

from arctictypescript.

pocesar avatar pocesar commented on June 17, 2024

so I can't have a definition file with all my generated references and I need to use files to set every possible ts file in my project?

from arctictypescript.

brakmic avatar brakmic commented on June 17, 2024

Sure, here are the examples:

I use a central d.ts file called etc.d.ts

///<reference path="typings/vendor/jquery/jquery.d.ts"/>
///<reference path="typings/vendor/knockout/knockout.d.ts"/>
///<reference path="typings/vendor/kendoui/kendo.all.d.ts"/>
///<reference path="typings/vendor/devextreme/dx.devextreme.d.ts"/>
///<reference path="typings/advarics/app-defs.ts"/>
///<reference path="widgets/widget-config.ts"/>
///<reference path="widgets/widget-defs.ts"/>
///<reference path="apis/web-api.ts"/>

One of my files is widget-config.ts which references etc.d.ts

///<reference path="../etc.d.ts"/>
import _defs = require('widget-defs');
import defs = _defs.WidgetDefs;

/* Widget-Configurator Classes & Interfaces */
export module WidgetConfig {

    /* base interface for grid configurators */
    export interface GridConfigurator extends defs.WidgetConfigurator {
        getColumns: (gridType: defs.GridType, columnDescriptors: Array<defs.ColumnDescriptor>) => Array<any>;
        getColumn: (columnType: defs.ColumnType, columnDescriptor: defs.ColumnDescriptor) => any;
        getColumnType: (gridType: defs.GridType) => defs.ColumnType;
        getFieldTypeName: (fieldType: defs.DataType, columnType: defs.ColumnType) => string;
        getInteractiveColumns: (gridName: string) => Array<any>;
        setInteractiveColumns: (gridName: string, descriptors: Array<defs.InteractiveColumnDescriptor>) => void;
        customizeColumns: (gridType: defs.GridType, columns: Array<any>, customizer: defs.ColumnCustomizer) => Array<any>;
    }

    /* initial implementation of a vendor-independent grid configurator */
    export class AdvaricsGridConfigurator implements GridConfigurator {
        private version: string = '0.0.1';
        private interactiveColumnDescriptors: { [gridName: string]: Array<defs.InteractiveColumnDescriptor> };
        /* ctor */
        constructor()         {
            console.log('AdvaricsGridConfigurator v' + this.version + ' initialized');
        }

from arctictypescript.

pocesar avatar pocesar commented on June 17, 2024

oh the filesGlob worked wonders, got everything I needed plus the definition files. it seems to be working now

from arctictypescript.

brakmic avatar brakmic commented on June 17, 2024

My completion still shows any possible value and not only those from within the context.

from arctictypescript.

Phaiax avatar Phaiax commented on June 17, 2024

Yeah I know :D I have to make some university stuff today, but my schedule is to investigate into this in the evening. I maybe do a livestream on livecoding.tv :D (i really would like to see If I am capable of livestreaming^^)

from arctictypescript.

brakmic avatar brakmic commented on June 17, 2024

No prob!
Thanks!
👍

from arctictypescript.

Phaiax avatar Phaiax commented on June 17, 2024

PS: livecoding.tv/phaiax

from arctictypescript.

brakmic avatar brakmic commented on June 17, 2024

👍

from arctictypescript.

Phaiax avatar Phaiax commented on June 17, 2024

Please wait for the next release (0.6.1), then execute these commands in the sublime console and send me back the debug output also printed in the console.

import ArcticTypescript.lib as a
a.utils.debug.print_classifications.append('autocomplete')

from arctictypescript.

brakmic avatar brakmic commented on June 17, 2024

Here's the debug output. I shortened some paths and removed the long plugin-loaded entries that get inserted when Sublime starts. The stack-overflows happen when I try to use the code completion.

ArcticTypescript: notify  : Try open project: [...]\cockpitwebrole
ArcticTypescript: notify  : starting tsserver 
[...]\cockpitwebrole\tsconfig.json
SublimeLinter: found existing HTML syntax, version 3 
SublimeLinter: found existing Rails syntax, version 1 
found 25 files for base name Main.sublime-menu
reloading Packages/User/SublimeServer.sublime-settings
Emmet: No need to update PyV8
ArcticTypescript: notify  : Initializion finished
Package Control: Skipping automatic upgrade, last run at 2015-03-15 22:26:53, next run at 2015-03-15 23:26:53 or after
Writing file [...]/Scripts/advarics/tasks.ts with encoding UTF-8
stack overflowed during match
stack overflowed during match
stack overflowed during match
stack overflowed during match
stack overflowed during match
stack overflowed during match
stack overflowed during match
stack overflowed during match
stack overflowed during match
stack overflowed during match
stack overflowed during match
stack overflowed during match
stack overflowed during match
stack overflowed during match
stack overflowed during match
stack overflowed during match
Writing file [....] widgets/widget-config.ts with encoding UTF-8

from arctictypescript.

Phaiax avatar Phaiax commented on June 17, 2024

(damn, this stack overflow worries me..)

That's not really what I wanted, please can you do this again:

  • restart sublime
  • type the two commands to the console
  • do autocompletion twice in the class AdvaricsGridConfigurator
    • once in an empty line in the contructor (ctrl + space)
    • once after a this. (the '.' should trigger autocompletion itself)
  • give me the ArcticTypescript: autocomplete lines

from arctictypescript.

brakmic avatar brakmic commented on June 17, 2024
>>> import ArcticTypescript.lib as a
>>> a.utils.debug.print_classifications.append('autocomplete')
ArcticTypescript: autocomplete: Autocompletion for line 25 , 13, forced=True
ArcticTypescript: autocomplete:  -> use cursor position 13 for autocomplete
ArcticTypescript: autocomplete:  -> push current file contents as update to tss.js
ArcticTypescript: autocomplete: Send async completion command for line 25 , 13
ArcticTypescript: autocomplete: Autocompletion results available for line 25 , 13
ArcticTypescript: autocomplete:  -> prepare List (927 items)
ArcticTypescript: autocomplete:  => CL: 24, L: 24, efcr: cursor, ccc: 12, col: 12, ismstr: false
ArcticTypescript: autocomplete:  -> command to sublime to now show autocomplete box with prepared list
ArcticTypescript: autocomplete: on_query_completions(), sublime wants to see the results, cursor currently at 25 , 13 (enabled: 15, items: 927)
ArcticTypescript: autocomplete:  -> (sublime cmd finished)
ArcticTypescript: autocomplete: on_query_completions(), sublime wants to see the results, cursor currently at 25 , 17 (enabled: -1, items: 927)
ArcticTypescript: autocomplete: Autocompletion for line 25 , 18, forced=False
ArcticTypescript: autocomplete:  -> use dot as referene
ArcticTypescript: autocomplete:  -> push current file contents as update to tss.js
ArcticTypescript: autocomplete: Send async completion command for line 25 , 18
ArcticTypescript: autocomplete: Autocompletion results available for line 25 , 18
ArcticTypescript: autocomplete:  -> prepare List (927 items)
ArcticTypescript: autocomplete:  => CL: 24, L: 24, efcr: dot, ccc: 17, col: 17, ismstr: true
ArcticTypescript: autocomplete:  -> command to sublime to now show autocomplete box with prepared list
ArcticTypescript: autocomplete: on_query_completions(), sublime wants to see the results, cursor currently at 25 , 18 (enabled: 15, items: 927)
ArcticTypescript: autocomplete:  -> (sublime cmd finished)

from arctictypescript.

brakmic avatar brakmic commented on June 17, 2024

In v0.6.2 I get this error now (I can only paste a screenshot because the project initialization doesn't stop and therefore blocks Sublime)

tserror

from arctictypescript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.