├── lib ├── __init__.py ├── display │ ├── __init__.py │ ├── views │ │ ├── __init__.py │ │ ├── Compile.py │ │ └── Outline.py │ ├── Panel.py │ └── Message.py ├── system │ ├── __init__.py │ ├── globals.py │ ├── busted │ │ ├── Liste.py │ │ └── Settings.py │ └── ErrorsHighlighter.py ├── test │ ├── __init__.py │ ├── test_foo.py │ ├── test_utils.py │ └── test_project.py ├── commands │ ├── __init__.py │ └── Refactor.py ├── server │ ├── TsserverWrapper.py │ └── typescripttoolsparser.py ├── utils │ ├── __init__.py │ ├── osutils.py │ ├── debounce.py │ ├── uiutils.py │ ├── CancelCommand.py │ ├── viewutils.py │ ├── utils.py │ ├── options.py │ ├── fileutils.py │ ├── disabling.py │ ├── pathutils.py │ └── debug.py └── tsconfiglint │ └── TsconfigListener.py ├── .no-sublime-package ├── tests ├── Defaultproject │ └── main.ts ├── DTSTest │ ├── backbone.ts │ └── main.ts ├── TDDTesting │ ├── card.ts │ ├── tsconfig.json │ └── main.ts ├── WrongReferencedRoot │ ├── lib │ │ ├── specialLibFkt.ts │ │ ├── mylib.ts │ │ ├── anotherFile.ts │ │ └── filewithoutexports.ts │ └── main.ts ├── Spaces in dir │ ├── lib │ │ └── mylib.ts │ ├── main2.ts │ ├── out.js │ ├── out.js.map │ └── tsconfig.json └── WizzardTest │ ├── lib │ └── mylib.ts │ └── main2.ts ├── examples ├── most_simple │ ├── tsconfig.json │ ├── utils.ts │ ├── utils.js │ ├── program.js │ └── program.ts ├── amd_modules_with_tests │ ├── built │ │ └── js │ │ │ └── git_folderkeeper │ ├── src │ │ ├── lib │ │ │ ├── tsd.d.ts │ │ │ └── sinon-chai │ │ │ │ └── sinon-chai.d.ts │ │ ├── utils │ │ │ └── utils.ts │ │ ├── testrunner.ts │ │ ├── app.ts │ │ └── tests │ │ │ └── utilstest.ts │ ├── Gruntfile.js │ ├── tsconfig.json │ ├── res │ │ ├── test.html │ │ └── index.html │ └── package.json ├── using_commonjs_modules │ ├── built │ │ ├── app.js │ │ └── utils │ │ │ └── utils.js │ ├── src │ │ ├── app.ts │ │ └── utils │ │ │ └── utils.ts │ ├── tsconfig.json │ └── package.json ├── single_out_file │ ├── main.ts │ ├── tsconfig.json │ ├── second.ts │ ├── out.js │ └── out.js.map ├── using_amd_modules │ ├── src │ │ ├── app.ts │ │ └── utils │ │ │ └── utils.ts │ ├── built │ │ └── js │ │ │ ├── app.js │ │ │ ├── app.js.map │ │ │ └── utils │ │ │ ├── utils.js.map │ │ │ └── utils.js │ └── tsconfig.json ├── common_js_modules_with_tests │ ├── src │ │ ├── lib │ │ │ ├── tsd.d.ts │ │ │ └── sinon-chai │ │ │ │ └── sinon-chai.d.ts │ │ ├── utils │ │ │ └── utils.ts │ │ ├── app.ts │ │ └── test │ │ │ └── utilstest.ts │ ├── built │ │ ├── app.js │ │ ├── utils │ │ │ └── utils.js │ │ └── test │ │ │ └── utilstest.js │ ├── tsconfig.json │ └── package.json └── basic_browser_project │ ├── tsconfig.json │ ├── src │ ├── main.ts │ ├── main2.ts │ └── insanity.ts │ └── built │ ├── index.html │ ├── mycode.js.map │ └── mycode.js ├── bin ├── node_modules │ ├── .bin │ │ └── tsc │ ├── glob-expand │ │ ├── node_modules │ │ │ └── glob │ │ │ │ ├── .npmignore │ │ │ │ ├── node_modules │ │ │ │ ├── minimatch │ │ │ │ │ ├── .npmignore │ │ │ │ │ ├── node_modules │ │ │ │ │ │ ├── lru-cache │ │ │ │ │ │ │ ├── .npmignore │ │ │ │ │ │ │ ├── CONTRIBUTORS │ │ │ │ │ │ │ ├── test │ │ │ │ │ │ │ │ ├── memory-leak.js │ │ │ │ │ │ │ │ └── foreach.js │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ └── package.json │ │ │ │ │ │ └── sigmund │ │ │ │ │ │ │ ├── test │ │ │ │ │ │ │ └── basic.js │ │ │ │ │ │ │ ├── sigmund.js │ │ │ │ │ │ │ ├── LICENSE │ │ │ │ │ │ │ ├── README.md │ │ │ │ │ │ │ └── package.json │ │ │ │ │ ├── test │ │ │ │ │ │ ├── extglob-ending-with-state-char.js │ │ │ │ │ │ ├── caching.js │ │ │ │ │ │ └── brace-expand.js │ │ │ │ │ └── LICENSE │ │ │ │ ├── graceful-fs │ │ │ │ │ ├── .npmignore │ │ │ │ │ ├── test │ │ │ │ │ │ ├── open.js │ │ │ │ │ │ └── ulimit.js │ │ │ │ │ ├── README.md │ │ │ │ │ ├── LICENSE │ │ │ │ │ └── package.json │ │ │ │ └── inherits │ │ │ │ │ ├── inherits.js │ │ │ │ │ ├── README.md │ │ │ │ │ └── package.json │ │ │ │ ├── .travis.yml │ │ │ │ ├── examples │ │ │ │ ├── usr-local.js │ │ │ │ └── g.js │ │ │ │ ├── test │ │ │ │ ├── zz-cleanup.js │ │ │ │ ├── root-nomount.js │ │ │ │ ├── root.js │ │ │ │ ├── cwd-test.js │ │ │ │ ├── bash-comparison.js │ │ │ │ ├── mark.js │ │ │ │ ├── pause-resume.js │ │ │ │ └── nocase-nomagic.js │ │ │ │ └── LICENSE │ │ ├── history.md │ │ ├── readme.md │ │ ├── build │ │ │ └── code │ │ │ │ └── expand.js │ │ ├── Gruntfile.coffee │ │ └── package.json │ └── typescript │ │ ├── bin │ │ └── tsc │ │ ├── .npmignore │ │ ├── .editorconfig │ │ ├── CopyrightNotice.txt │ │ ├── ThirdPartyNoticeText.txt │ │ └── README.md ├── tss ├── defaultLibs.d.ts ├── package.json ├── refactor.js ├── expandglob.js └── harness.js ├── messages.json ├── icons ├── bright-illegal.png ├── bright-warning.png ├── simple-illegal.png ├── simple-warning.png ├── bright-violation.png └── simple-violation.png ├── screenshots ├── 08_build.png ├── animated.gif ├── 11_commands.png ├── 02_errorlist.png ├── 03_quickinfo.png ├── 05_errorjump.png ├── orig │ ├── 08_build.png │ ├── 11_commands.png │ ├── 02_errorlist.png │ ├── 03_quickinfo.png │ ├── 05_errorjump.png │ ├── 06_snippet_for1.png │ ├── 07_snippet_for2.png │ ├── 01_code_completion.png │ ├── 09_view_build_file.png │ ├── 04_jumpto_declaration.png │ └── 10_tsconfig_validation.png ├── 06_snippet_for1.png ├── 07_snippet_for2.png ├── 01_code_completion.png ├── 01_code_completion.xcf ├── 09_view_build_file.png ├── 04_jumpto_declaration.png └── 10_tsconfig_validation.png ├── unittesting.json ├── snippets ├── log.sublime-snippet ├── return-FALSE.sublime-snippet ├── return-TRUE.sublime-snippet ├── return.sublime-snippet ├── throw.sublime-snippet ├── if.sublime-snippet ├── Constructor.sublime-snippet ├── import-require.sublime-snippet ├── setTimeout.sublime-snippet ├── reference.sublime-snippet ├── do-while(-).sublime-snippet ├── reference_via_slash.sublime-snippet ├── for-(in)-{}.sublime-snippet ├── function-(fun).sublime-snippet ├── method-(fun).sublime-snippet ├── get-()-{}.sublime-snippet ├── if-___-else.sublime-snippet ├── set-()-{}.sublime-snippet ├── for-()-{}.sublime-snippet ├── for-()-{[]}.sublime-snippet ├── class-{-}.sublime-snippet ├── for-()-{}-(faster).sublime-snippet ├── switch(-).sublime-snippet ├── property.sublime-snippet └── snippetlist.sublime-snippet ├── ArcticTypescript.sublime-settings ├── messages ├── 0.4.0.txt ├── 0.6.0.txt └── 0.5.0.txt ├── CHANGES.txt ├── .gitattributes ├── Comments.tmPreferences ├── TODO.md ├── LICENCE.txt ├── Main.sublime-menu ├── TESTING.md ├── Default.sublime-keymap ├── Default.sublime-commands └── ArcticTypescript.py /lib/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.no-sublime-package: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/display/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/system/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/test/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/commands/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/Defaultproject/main.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/display/views/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/DTSTest/backbone.ts: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /examples/most_simple/tsconfig.json: -------------------------------------------------------------------------------- 1 | { } -------------------------------------------------------------------------------- /bin/node_modules/.bin/tsc: -------------------------------------------------------------------------------- 1 | ../typescript/bin/tsc -------------------------------------------------------------------------------- /tests/TDDTesting/card.ts: -------------------------------------------------------------------------------- 1 | 2 | var card = "qe"; -------------------------------------------------------------------------------- /lib/server/TsserverWrapper.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | -------------------------------------------------------------------------------- /bin/tss: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require('./tss.js') 3 | -------------------------------------------------------------------------------- /examples/amd_modules_with_tests/built/js/git_folderkeeper: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "0.4.0": "messages/0.4.0.txt", 3 | } -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/.npmignore: -------------------------------------------------------------------------------- 1 | .*.swp 2 | test/a/ 3 | -------------------------------------------------------------------------------- /bin/node_modules/typescript/bin/tsc: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require('./tsc.js') 3 | -------------------------------------------------------------------------------- /examples/most_simple/utils.ts: -------------------------------------------------------------------------------- 1 | 2 | module Utils { 3 | export var g = 9.81; 4 | } -------------------------------------------------------------------------------- /bin/defaultLibs.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/node_modules/minimatch/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/node_modules/graceful-fs/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /tests/WrongReferencedRoot/lib/specialLibFkt.ts: -------------------------------------------------------------------------------- 1 | 2 | export function specialLibFkt() { 3 | 4 | 5 | } -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.8 4 | -------------------------------------------------------------------------------- /icons/bright-illegal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/icons/bright-illegal.png -------------------------------------------------------------------------------- /icons/bright-warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/icons/bright-warning.png -------------------------------------------------------------------------------- /icons/simple-illegal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/icons/simple-illegal.png -------------------------------------------------------------------------------- /icons/simple-warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/icons/simple-warning.png -------------------------------------------------------------------------------- /screenshots/08_build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/screenshots/08_build.png -------------------------------------------------------------------------------- /screenshots/animated.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/screenshots/animated.gif -------------------------------------------------------------------------------- /tests/Spaces in dir/lib/mylib.ts: -------------------------------------------------------------------------------- 1 | 2 | module LIB { 3 | export function lol() { 4 | return 1; 5 | } 6 | } -------------------------------------------------------------------------------- /tests/WizzardTest/lib/mylib.ts: -------------------------------------------------------------------------------- 1 | 2 | module LIB { 3 | export function lol() { 4 | return 1; 5 | } 6 | } -------------------------------------------------------------------------------- /bin/node_modules/typescript/.npmignore: -------------------------------------------------------------------------------- 1 | built 2 | doc 3 | scripts 4 | src 5 | tests 6 | Jakefile 7 | .travis.yml -------------------------------------------------------------------------------- /icons/bright-violation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/icons/bright-violation.png -------------------------------------------------------------------------------- /icons/simple-violation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/icons/simple-violation.png -------------------------------------------------------------------------------- /screenshots/11_commands.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/screenshots/11_commands.png -------------------------------------------------------------------------------- /screenshots/02_errorlist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/screenshots/02_errorlist.png -------------------------------------------------------------------------------- /screenshots/03_quickinfo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/screenshots/03_quickinfo.png -------------------------------------------------------------------------------- /screenshots/05_errorjump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/screenshots/05_errorjump.png -------------------------------------------------------------------------------- /screenshots/orig/08_build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/screenshots/orig/08_build.png -------------------------------------------------------------------------------- /unittesting.json: -------------------------------------------------------------------------------- 1 | { 2 | "tests_dir" : "lib/test", 3 | "async": false, 4 | "deferred": true, 5 | "verbosity": 2 6 | } -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/.npmignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | -------------------------------------------------------------------------------- /examples/most_simple/utils.js: -------------------------------------------------------------------------------- 1 | var Utils; 2 | (function (Utils) { 3 | Utils.g = 9.81; 4 | })(Utils || (Utils = {})); 5 | -------------------------------------------------------------------------------- /screenshots/06_snippet_for1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/screenshots/06_snippet_for1.png -------------------------------------------------------------------------------- /screenshots/07_snippet_for2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/screenshots/07_snippet_for2.png -------------------------------------------------------------------------------- /screenshots/orig/11_commands.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/screenshots/orig/11_commands.png -------------------------------------------------------------------------------- /screenshots/01_code_completion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/screenshots/01_code_completion.png -------------------------------------------------------------------------------- /screenshots/01_code_completion.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/screenshots/01_code_completion.xcf -------------------------------------------------------------------------------- /screenshots/09_view_build_file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/screenshots/09_view_build_file.png -------------------------------------------------------------------------------- /screenshots/orig/02_errorlist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/screenshots/orig/02_errorlist.png -------------------------------------------------------------------------------- /screenshots/orig/03_quickinfo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/screenshots/orig/03_quickinfo.png -------------------------------------------------------------------------------- /screenshots/orig/05_errorjump.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/screenshots/orig/05_errorjump.png -------------------------------------------------------------------------------- /screenshots/04_jumpto_declaration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/screenshots/04_jumpto_declaration.png -------------------------------------------------------------------------------- /screenshots/orig/06_snippet_for1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/screenshots/orig/06_snippet_for1.png -------------------------------------------------------------------------------- /screenshots/orig/07_snippet_for2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/screenshots/orig/07_snippet_for2.png -------------------------------------------------------------------------------- /screenshots/10_tsconfig_validation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/screenshots/10_tsconfig_validation.png -------------------------------------------------------------------------------- /screenshots/orig/01_code_completion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/screenshots/orig/01_code_completion.png -------------------------------------------------------------------------------- /screenshots/orig/09_view_build_file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/screenshots/orig/09_view_build_file.png -------------------------------------------------------------------------------- /tests/Spaces in dir/main2.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | //import T = require('lib/mylib'); 4 | 5 | 6 | LIB.lol() 7 | -------------------------------------------------------------------------------- /screenshots/orig/04_jumpto_declaration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/screenshots/orig/04_jumpto_declaration.png -------------------------------------------------------------------------------- /tests/WrongReferencedRoot/lib/mylib.ts: -------------------------------------------------------------------------------- 1 | 2 | //import r = require('anotherFile') 3 | 4 | export function lodl() { 5 | return 1; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /examples/using_commonjs_modules/built/app.js: -------------------------------------------------------------------------------- 1 | var U = require('./utils/utils'); 2 | U.TotalBasicUtils.a(); 3 | (new U.TotalBasicUtils()).b(); 4 | -------------------------------------------------------------------------------- /screenshots/orig/10_tsconfig_validation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Phaiax/ArcticTypescript/HEAD/screenshots/orig/10_tsconfig_validation.png -------------------------------------------------------------------------------- /examples/single_out_file/main.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | var second = new Testmodule.Test() 4 | second.start(); 5 | second.stop(); -------------------------------------------------------------------------------- /tests/Spaces in dir/out.js: -------------------------------------------------------------------------------- 1 | /// 2 | //import T = require('lib/mylib'); 3 | LIB.lol(); 4 | //# sourceMappingURL=out.js.map -------------------------------------------------------------------------------- /tests/WrongReferencedRoot/lib/anotherFile.ts: -------------------------------------------------------------------------------- 1 | 2 | import specialLibFkt = require('specialLibFkt'); 3 | 4 | export function anotherFile() { 5 | 6 | } -------------------------------------------------------------------------------- /examples/using_amd_modules/src/app.ts: -------------------------------------------------------------------------------- 1 | 2 | import U = require('./utils/utils'); 3 | 4 | U.TotalBasicUtils.a(); 5 | 6 | (new U.TotalBasicUtils()).b(); 7 | -------------------------------------------------------------------------------- /examples/using_commonjs_modules/src/app.ts: -------------------------------------------------------------------------------- 1 | 2 | import U = require('./utils/utils'); 3 | 4 | U.TotalBasicUtils.a(); 5 | 6 | (new U.TotalBasicUtils()).b(); 7 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/history.md: -------------------------------------------------------------------------------- 1 | 0.0.2 - Adding support for `RegExp` along with string minimatch patterns 2 | 3 | 0.0.1 - Initial release - a faithful copy of grunt's expand -------------------------------------------------------------------------------- /tests/Spaces in dir/out.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"out.js","sourceRoot":"","sources":["main2.ts"],"names":[],"mappings":"AAAA,oCAAoC;AAKpC,AAHA,kCAAkC;AAGlC,GAAG,CAAC,GAAG,EAAE,CAAA"} -------------------------------------------------------------------------------- /tests/WrongReferencedRoot/lib/filewithoutexports.ts: -------------------------------------------------------------------------------- 1 | 2 | // this file has only some imports, no exports 3 | 4 | import special = require('specialLibFkt'); 5 | 6 | //export var = 2; -------------------------------------------------------------------------------- /tests/WrongReferencedRoot/main.ts: -------------------------------------------------------------------------------- 1 | 2 | import T = require('lib/mylib'); 3 | 4 | 5 | T.lol() 6 | 7 | 8 | // always delete any .sublimets or ,sublime-project file 9 | // after testing -------------------------------------------------------------------------------- /examples/using_amd_modules/src/utils/utils.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | export class TotalBasicUtils { 4 | 5 | constructor() {} 6 | 7 | static a() { 8 | console.log("a") 9 | } 10 | 11 | b() { 12 | console.log("b") 13 | } 14 | } -------------------------------------------------------------------------------- /snippets/log.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 4 | log 5 | source.ts 6 | console log 7 | -------------------------------------------------------------------------------- /snippets/return-FALSE.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | r0 4 | source.ts 5 | return false 6 | -------------------------------------------------------------------------------- /snippets/return-TRUE.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | r1 4 | source.ts 5 | return true 6 | -------------------------------------------------------------------------------- /snippets/return.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | ret 4 | source.ts 5 | return statement 6 | -------------------------------------------------------------------------------- /snippets/throw.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 4 | thr 5 | source.ts 6 | Throw Exception 7 | -------------------------------------------------------------------------------- /tests/Spaces in dir/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "out": "out.js", 4 | "sourceMap": true, 5 | "target": "es5" 6 | }, 7 | "files": [ 8 | "main2.ts" 9 | ] 10 | } -------------------------------------------------------------------------------- /examples/single_out_file/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "out": "out.js", 4 | "sourceMap": true, 5 | "target": "es5" 6 | }, 7 | "files": [ 8 | "main.ts" 9 | ] 10 | } -------------------------------------------------------------------------------- /examples/using_amd_modules/built/js/app.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports", './utils/utils'], function (require, exports, U) { 2 | U.TotalBasicUtils.a(); 3 | (new U.TotalBasicUtils()).b(); 4 | }); 5 | //# sourceMappingURL=app.js.map -------------------------------------------------------------------------------- /examples/using_commonjs_modules/src/utils/utils.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | export class TotalBasicUtils { 4 | 5 | constructor() {} 6 | 7 | static a() { 8 | console.log("a") 9 | } 10 | 11 | b() { 12 | console.log("b") 13 | } 14 | } -------------------------------------------------------------------------------- /lib/test/test_foo.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | import sublime, sys 4 | from sublime_unittest import TestCase 5 | 6 | 7 | 8 | class test_foobar(TestCase): 9 | def test_foobar(self): 10 | self.assertEqual(13, 13) 11 | -------------------------------------------------------------------------------- /bin/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bin-folder-from-ArcticTypescript", 3 | "description": "this file only exists to manage dependencies", 4 | "dependencies":{ 5 | "glob-expand": "0.0.2", 6 | "typescript": "Microsoft/TypeScript" 7 | } 8 | } -------------------------------------------------------------------------------- /examples/amd_modules_with_tests/src/lib/tsd.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | -------------------------------------------------------------------------------- /snippets/if.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | if 6 | source.ts 7 | if … 8 | -------------------------------------------------------------------------------- /examples/common_js_modules_with_tests/src/lib/tsd.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | -------------------------------------------------------------------------------- /examples/using_commonjs_modules/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "outDir": "built/", 5 | "target": "es5" 6 | }, 7 | "files": [ 8 | "src/app.ts" 9 | ] 10 | } -------------------------------------------------------------------------------- /examples/using_amd_modules/built/js/app.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/app.ts"],"names":[],"mappings":"4EACO,CAAC;IAER,CAAC,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC;IAEtB,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC"} -------------------------------------------------------------------------------- /examples/common_js_modules_with_tests/built/app.js: -------------------------------------------------------------------------------- 1 | var U = require('./utils/utils'); 2 | // for node and mocha install these packets first: 3 | // > npm install 4 | var what = U.TotalBasicUtils.a(); 5 | (new U.TotalBasicUtils()).b(); 6 | console.log(what); 7 | -------------------------------------------------------------------------------- /snippets/Constructor.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 6 | ctor 7 | source.ts 8 | constructor … 9 | -------------------------------------------------------------------------------- /snippets/import-require.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 4 | imp 5 | source.ts 6 | imports a module … 7 | -------------------------------------------------------------------------------- /snippets/setTimeout.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | {$0}${2:}, ${1:500});]]> 3 | to 4 | source.ts 5 | setTimeout function 6 | -------------------------------------------------------------------------------- /snippets/reference.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | $0]]> 4 | ref 5 | source.ts 6 | does a triple-slash reference 7 | -------------------------------------------------------------------------------- /bin/node_modules/typescript/.editorconfig: -------------------------------------------------------------------------------- 1 | 2 | root = true 3 | 4 | [{src,scripts}/**.{ts,json,js}] 5 | end_of_line = crlf 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | indent_style = space 10 | indent_size = 4 11 | -------------------------------------------------------------------------------- /examples/amd_modules_with_tests/src/utils/utils.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | export class TotalBasicUtils { 4 | 5 | constructor() {} 6 | 7 | static a() { 8 | console.log("a") 9 | return "a" 10 | } 11 | 12 | b() { 13 | console.log("b") 14 | return "c" 15 | } 16 | } -------------------------------------------------------------------------------- /examples/using_amd_modules/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "amd", 4 | "outDir": "built/js/", 5 | "sourceMap": true, 6 | "target": "es5" 7 | }, 8 | "files": [ 9 | "src/app.ts" 10 | ] 11 | } -------------------------------------------------------------------------------- /snippets/do-while(-).sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | do 6 | source.ts 7 | do … while … 8 | -------------------------------------------------------------------------------- /snippets/reference_via_slash.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 3 | $0]]> 4 | /// 5 | source.ts 6 | does a triple-slash reference 7 | -------------------------------------------------------------------------------- /examples/basic_browser_project/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "out": "built/mycode.js", 4 | "sourceMap": true, 5 | "target": "es5" 6 | }, 7 | "files": [ 8 | "src/main.ts", 9 | "src/main2.ts" 10 | ] 11 | } -------------------------------------------------------------------------------- /examples/common_js_modules_with_tests/src/utils/utils.ts: -------------------------------------------------------------------------------- 1 | 2 | 3 | export class TotalBasicUtils { 4 | 5 | constructor() {} 6 | 7 | static a() { 8 | // console.log("a") 9 | return "a"; 10 | } 11 | 12 | b() { 13 | // console.log("b") 14 | return "b"; 15 | } 16 | } -------------------------------------------------------------------------------- /lib/utils/__init__.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | # import the most used utils 4 | 5 | from .debug import Debug, max_calls 6 | from .utils import get_first, get_deep, version, encode, make_hash, random_str, \ 7 | replace_variables 8 | from .pathutils import package_path -------------------------------------------------------------------------------- /snippets/for-(in)-{}.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | forin 6 | source.ts 7 | for … in … loop 8 | 9 | -------------------------------------------------------------------------------- /snippets/function-(fun).sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | f 6 | source.ts 7 | Function 8 | -------------------------------------------------------------------------------- /snippets/method-(fun).sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | met 6 | source.ts 7 | class method 8 | -------------------------------------------------------------------------------- /examples/single_out_file/second.ts: -------------------------------------------------------------------------------- 1 | 2 | module Testmodule { 3 | export class Test{ 4 | 5 | constructor(){ 6 | 7 | } 8 | 9 | public start(){ 10 | return this; 11 | } 12 | 13 | public stop(){ 14 | return this; 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /snippets/get-()-{}.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 7 | get 8 | source.ts 9 | get-property … 10 | -------------------------------------------------------------------------------- /snippets/if-___-else.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 7 | ie 8 | source.ts 9 | if … else … 10 | -------------------------------------------------------------------------------- /snippets/set-()-{}.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 7 | set 8 | source.ts 9 | set-property … 10 | -------------------------------------------------------------------------------- /examples/common_js_modules_with_tests/src/app.ts: -------------------------------------------------------------------------------- 1 | 2 | import U = require('./utils/utils'); 3 | 4 | // for node and mocha install these packets first: 5 | // > npm install 6 | 7 | var what : string = U.TotalBasicUtils.a(); 8 | 9 | (new U.TotalBasicUtils()).b(); 10 | 11 | 12 | console.log(what); -------------------------------------------------------------------------------- /snippets/for-()-{}.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | for 6 | source.ts 7 | for (…; ++i) {…} 8 | 9 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/examples/usr-local.js: -------------------------------------------------------------------------------- 1 | var Glob = require("../").Glob 2 | 3 | var pattern = "{./*/*,/*,/usr/local/*}" 4 | console.log(pattern) 5 | 6 | var mg = new Glob(pattern, {mark: true}, function (er, matches) { 7 | console.log("matches", matches) 8 | }) 9 | console.log("after") 10 | -------------------------------------------------------------------------------- /tests/TDDTesting/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "out": "out.js", 4 | "sourceMap": true, 5 | "target": "es5" 6 | }, 7 | "files": [ 8 | "main.ts", 9 | "card.ts" 10 | ], 11 | "ArcticTypescript": { 12 | "enable_refactoring": true 13 | } 14 | } -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/examples/g.js: -------------------------------------------------------------------------------- 1 | var Glob = require("../").Glob 2 | 3 | var pattern = "test/a/**/[cg]/../[cg]" 4 | console.log(pattern) 5 | 6 | var mg = new Glob(pattern, {mark: true, sync:true}, function (er, matches) { 7 | console.log("matches", matches) 8 | }) 9 | console.log("after") 10 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/node_modules/minimatch/test/extglob-ending-with-state-char.js: -------------------------------------------------------------------------------- 1 | var test = require('tap').test 2 | var minimatch = require('../') 3 | 4 | test('extglob ending with statechar', function(t) { 5 | t.notOk(minimatch('ax', 'a?(b*)')) 6 | t.ok(minimatch('ax', '?(a*|b)')) 7 | t.end() 8 | }) 9 | -------------------------------------------------------------------------------- /snippets/for-()-{[]}.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 5 | forl 6 | source.ts 7 | for (… .length; i++) {…} 8 | 9 | -------------------------------------------------------------------------------- /snippets/class-{-}.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 10 | cls 11 | source.ts 12 | class … 13 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/test/zz-cleanup.js: -------------------------------------------------------------------------------- 1 | // remove the fixtures 2 | var tap = require("tap") 3 | , rimraf = require("rimraf") 4 | , path = require("path") 5 | 6 | tap.test("cleanup fixtures", function (t) { 7 | rimraf(path.resolve(__dirname, "a"), function (er) { 8 | t.ifError(er, "removed") 9 | t.end() 10 | }) 11 | }) 12 | -------------------------------------------------------------------------------- /examples/amd_modules_with_tests/src/testrunner.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | 5 | 6 | import utilstest = require('./tests/utilstest'); 7 | 8 | mocha.setup('bdd'); 9 | 10 | utilstest.declare(); 11 | 12 | mocha.run(); 13 | 14 | -------------------------------------------------------------------------------- /snippets/for-()-{}-(faster).sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | = 0; ${20:i}--) { 3 | ${100:${1:Things}[${20:i}]}$0 4 | }]]> 5 | forb 6 | source.ts 7 | (Improved Native For-Loop) for (…; i--) {…} 8 | 9 | -------------------------------------------------------------------------------- /ArcticTypescript.sublime-settings: -------------------------------------------------------------------------------- 1 | { 2 | "auto_complete" : true, 3 | "error_on_save_only" : false, 4 | "activate_build_system" : true, 5 | "enable_refactoring" : false, 6 | "node_path" : null, 7 | "tsc_path" : null, 8 | "build_on_save" : false, 9 | "pre_processing_commands" : [], 10 | "post_processing_commands" : [], 11 | "show_build_file" : false, 12 | } -------------------------------------------------------------------------------- /snippets/switch(-).sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 11 | sw 12 | source.ts 13 | switch statement … 14 | -------------------------------------------------------------------------------- /examples/using_commonjs_modules/built/utils/utils.js: -------------------------------------------------------------------------------- 1 | var TotalBasicUtils = (function () { 2 | function TotalBasicUtils() { 3 | } 4 | TotalBasicUtils.a = function () { 5 | console.log("a"); 6 | }; 7 | TotalBasicUtils.prototype.b = function () { 8 | console.log("b"); 9 | }; 10 | return TotalBasicUtils; 11 | })(); 12 | exports.TotalBasicUtils = TotalBasicUtils; 13 | -------------------------------------------------------------------------------- /tests/DTSTest/main.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | 5 | // only changed the /// 2 | 11 | prop 12 | source.ts 13 | full property … 14 | -------------------------------------------------------------------------------- /examples/basic_browser_project/src/main.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | 4 | var countdown_element: HTMLElement = document.getElementById('countdown_display'); 5 | var countdown_helper = new Insanity.CountdownToInsanity(countdown_element); 6 | 7 | countdown_helper.start() 8 | 9 | var stop_element: HTMLElement = document.getElementById('stop'); 10 | stop_element.onclick = function() { countdown_helper.stop(); } 11 | -------------------------------------------------------------------------------- /examples/most_simple/program.js: -------------------------------------------------------------------------------- 1 | /// 2 | // every file will get compiled but 3 | // there are no references, so 4 | // $ nodejs program.js 5 | // fill fail because utils.js is not included. 6 | // Solution: use 7 | // tsconfig.json['compilerOptions']['out'] = 'out.js' 8 | // to concat all output into one file, 9 | // considering the sequence of imports automatically 10 | console.log("Gravity" + Utils.g); 11 | -------------------------------------------------------------------------------- /examples/amd_modules_with_tests/src/app.ts: -------------------------------------------------------------------------------- 1 | 2 | import U = require('./utils/utils'); 3 | 4 | U.TotalBasicUtils.a(); 5 | 6 | (new U.TotalBasicUtils()).b(); 7 | 8 | setTimeout(function(){ 9 | document.getElementById("dyn").innerHTML = "Dynamic!" 10 | }, 1000); 11 | 12 | var k = {"abcde" : 22} 13 | 14 | class AClass { 15 | 16 | constructor(argument) { 17 | // code... 18 | } 19 | 20 | public test() : void { 21 | } 22 | } -------------------------------------------------------------------------------- /examples/amd_modules_with_tests/Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | // Do grunt-related things in here 3 | 4 | // Project configuration. 5 | grunt.initConfig({ 6 | pkg: grunt.file.readJSON('package.json'), 7 | copy: { 8 | main: { 9 | expand: true, 10 | cwd: 'res/', 11 | src: ['**'], 12 | dest: 'built/', 13 | }, 14 | }, 15 | }); 16 | 17 | 18 | grunt.loadNpmTasks('grunt-contrib-copy'); 19 | 20 | }; -------------------------------------------------------------------------------- /lib/system/globals.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | 4 | # ############## system/Project.py ######################################### 5 | 6 | OPENED_PROJECTS = {} 7 | 8 | # ############## Allows Disabling of ArcticTypescript ###################### 9 | 10 | plugin_disabled_for_folders = [] # path for certain folders or '*global' 11 | 12 | 13 | # ############## Standalone debouncing: utils/debounce.py ################## 14 | 15 | debounced_timers = {} 16 | 17 | -------------------------------------------------------------------------------- /examples/common_js_modules_with_tests/built/utils/utils.js: -------------------------------------------------------------------------------- 1 | var TotalBasicUtils = (function () { 2 | function TotalBasicUtils() { 3 | } 4 | TotalBasicUtils.a = function () { 5 | // console.log("a") 6 | return "a"; 7 | }; 8 | TotalBasicUtils.prototype.b = function () { 9 | // console.log("b") 10 | return "b"; 11 | }; 12 | return TotalBasicUtils; 13 | })(); 14 | exports.TotalBasicUtils = TotalBasicUtils; 15 | -------------------------------------------------------------------------------- /messages/0.4.0.txt: -------------------------------------------------------------------------------- 1 | Arctic Typescript: 2 | 3 | Note for users which have used additional "" in the typescript settings to enclose paths that included spaces. 4 | 5 | Example: 6 | "output_dir_path" : "\"Space In Foldername\"", 7 | "concatenate_and_emit_output_file_path" : "\"Space In Foldername\"", 8 | 9 | Action: 10 | Build will fail. You have to remove the additional enclosing "" 11 | 12 | Why: 13 | https://github.com/Phaiax/ArcticTypescript/issues/17 -------------------------------------------------------------------------------- /examples/common_js_modules_with_tests/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "outDir": "built/", 5 | "target": "es5" 6 | }, 7 | "files": [ 8 | "src/app.ts", 9 | "src/test/utilstest.ts" 10 | ], 11 | "ArcticTypescript": { 12 | "post_processing_commands": [ 13 | "${tsconfig_path}/node_modules/.bin/mocha -C -R spec ${outDirtest}" 14 | ] 15 | } 16 | } -------------------------------------------------------------------------------- /examples/most_simple/program.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | // every file will get compiled but 4 | // there are no references, so 5 | // $ nodejs program.js 6 | // fill fail because utils.js is not included. 7 | 8 | // Solution: use 9 | // tsconfig.json['compilerOptions']['out'] = 'out.js' 10 | // to concat all output into one file, 11 | // considering the sequence of imports automatically 12 | 13 | 14 | console.log("Gravity" + Utils.g); 15 | -------------------------------------------------------------------------------- /CHANGES.txt: -------------------------------------------------------------------------------- 1 | version 0.3.0 : 2 | renamed and cloned into ArcticTypescript 3 | included pull request #63 from T3S (https://github.com/Railk/T3S/pull/63) 4 | shortcuts changed 5 | 6 | version 0.2.0: 7 | 8 | 9 | version 0.1.2 : 10 | 11 | - added : 12 | . Go to definition 13 | . Navigate in file 14 | . Close all projects 15 | 16 | 17 | version 0.1.1 : 18 | 19 | - added : 20 | . reload project 21 | 22 | 23 | version 0.1.0 : 24 | 25 | - added : 26 | . error panel -------------------------------------------------------------------------------- /examples/using_amd_modules/built/js/utils/utils.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/utils/utils.ts"],"names":["TotalBasicUtils","TotalBasicUtils.constructor","TotalBasicUtils.a","TotalBasicUtils.b"],"mappings":";IAEA,IAAa,eAAe;QAE3BA,SAFYA,eAAeA;QAEZC,CAACA;QAETD,iBAACA,GAARA;YACCE,OAAOA,CAACA,GAAGA,CAACA,GAAGA,CAACA,CAAAA;QACjBA,CAACA;QAEDF,2BAACA,GAADA;YACCG,OAAOA,CAACA,GAAGA,CAACA,GAAGA,CAACA,CAAAA;QACjBA,CAACA;QACFH,sBAACA;IAADA,CAACA,AAXD,IAWC;IAXY,uBAAe,GAAf,eAWZ,CAAA"} -------------------------------------------------------------------------------- /tests/WizzardTest/main2.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | //import T = require('lib/mylib'); 4 | 5 | 6 | LIB.lol() 7 | 8 | 9 | //regaerg 10 | 11 | var t = 33; 12 | 13 | var s = { 14 | "my" : "yours", 15 | "yours" : {"his": "mine"} 16 | }; 17 | 18 | 19 | s.yours.his.match("Owen") 20 | 21 | 22 | var z; 23 | 24 | setTimeout("handler: any"," timeout?: any"," ...args: any[]") 25 | 26 | var a = new AnimationEvent(); 27 | 28 | a.initEvent("eventssssTypeArg: string",true,true); 29 | -------------------------------------------------------------------------------- /lib/display/views/Compile.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | from .Base import Base 4 | 5 | class Compile(Base): 6 | 7 | ts_view = None; 8 | 9 | def __init__(self, t3sviews): 10 | super(Compile, self).__init__('Typescript : Built File', t3sviews) 11 | 12 | def setup(self,ts_view): 13 | self.ts_view = ts_view 14 | 15 | def on_click(self,line): 16 | if self.ts_view: 17 | if self.ts_view.window(): 18 | self.ts_view.window().focus_view(self.ts_view) 19 | -------------------------------------------------------------------------------- /lib/utils/osutils.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | import os 4 | import subprocess 5 | 6 | # GET PROCESS KWARGS 7 | def get_kwargs(stderr=True): 8 | if os.name == 'nt': 9 | startupinfo = subprocess.STARTUPINFO() 10 | startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW 11 | if stderr: 12 | #errorlog = open(os.devnull, 'w') 13 | return {'stderr':subprocess.DEVNULL, 'startupinfo': startupinfo} 14 | return {'startupinfo': startupinfo} 15 | else: 16 | return {} -------------------------------------------------------------------------------- /examples/amd_modules_with_tests/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "outDir": "built/", 4 | "module": "amd", 5 | "sourceMap": true, 6 | "target": "es5" 7 | }, 8 | "files": [ 9 | "src/app.ts", 10 | "src/testrunner.ts", 11 | "src/tests/utilstest.ts", 12 | "src/utils/utils.ts" 13 | ], 14 | "ArcticTypescript": { 15 | "show_build_file": true, 16 | "post_processing_commands": [ 17 | "grunt copy" 18 | ] 19 | } 20 | } -------------------------------------------------------------------------------- /lib/utils/debounce.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | import threading 4 | 5 | from ..system.globals import debounced_timers 6 | 7 | 8 | DEFAULT_DEBOUNCE_DELAY = 0.2 # Will also be used for AsyncCommand debounce 9 | 10 | 11 | # DEBOUNCE CALL 12 | def debounce(fn, delay=DEFAULT_DEBOUNCE_DELAY, uid=None, *args): 13 | uid = uid if uid else fn 14 | 15 | if uid in debounced_timers: 16 | debounced_timers[uid].cancel() 17 | 18 | timer = threading.Timer(delay, fn, args) 19 | timer.start() 20 | 21 | debounced_timers[uid] = timer 22 | -------------------------------------------------------------------------------- /examples/using_amd_modules/built/js/utils/utils.js: -------------------------------------------------------------------------------- 1 | define(["require", "exports"], function (require, exports) { 2 | var TotalBasicUtils = (function () { 3 | function TotalBasicUtils() { 4 | } 5 | TotalBasicUtils.a = function () { 6 | console.log("a"); 7 | }; 8 | TotalBasicUtils.prototype.b = function () { 9 | console.log("b"); 10 | }; 11 | return TotalBasicUtils; 12 | })(); 13 | exports.TotalBasicUtils = TotalBasicUtils; 14 | }); 15 | //# sourceMappingURL=utils.js.map -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/node_modules/minimatch/test/caching.js: -------------------------------------------------------------------------------- 1 | var Minimatch = require("../minimatch.js").Minimatch 2 | var tap = require("tap") 3 | tap.test("cache test", function (t) { 4 | var mm1 = new Minimatch("a?b") 5 | var mm2 = new Minimatch("a?b") 6 | t.equal(mm1, mm2, "should get the same object") 7 | // the lru should drop it after 100 entries 8 | for (var i = 0; i < 100; i ++) { 9 | new Minimatch("a"+i) 10 | } 11 | mm2 = new Minimatch("a?b") 12 | t.notEqual(mm1, mm2, "cache should have dropped") 13 | t.end() 14 | }) 15 | -------------------------------------------------------------------------------- /lib/utils/uiutils.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | 4 | # ##################################################### MEMBER PREFIXES ######## 5 | 6 | PREFIXES = { 7 | 'method': u'○', 8 | 'property': u'●', 9 | 'class':u'♦', 10 | 'interface':u'◊', 11 | 'keyword':u'∆', 12 | 'constructor':u'■', 13 | 'variable': u'V', 14 | 'public':u'[pub]', 15 | 'private':u'[priv]', 16 | 'getter':u'<', 17 | 'setter':u'>' 18 | } 19 | 20 | 21 | def get_prefix(token): 22 | if token in PREFIXES: 23 | return PREFIXES[token] 24 | else: 25 | return '' -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /examples/single_out_file/out.js: -------------------------------------------------------------------------------- 1 | var Testmodule; 2 | (function (Testmodule) { 3 | var Test = (function () { 4 | function Test() { 5 | } 6 | Test.prototype.start = function () { 7 | return this; 8 | }; 9 | Test.prototype.stop = function () { 10 | return this; 11 | }; 12 | return Test; 13 | })(); 14 | Testmodule.Test = Test; 15 | })(Testmodule || (Testmodule = {})); 16 | /// 17 | var second = new Testmodule.Test(); 18 | second.start(); 19 | second.stop(); 20 | //# sourceMappingURL=out.js.map -------------------------------------------------------------------------------- /examples/single_out_file/out.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"out.js","sourceRoot":"","sources":["second.ts","main.ts"],"names":["Testmodule","Testmodule.Test","Testmodule.Test.constructor","Testmodule.Test.start","Testmodule.Test.stop"],"mappings":"AACA,IAAO,UAAU,CAehB;AAfD,WAAO,UAAU,EAAC,CAAC;IAClBA;QAEIC;QAEAC,CAACA;QAEMD,oBAAKA,GAAZA;YACIE,MAAMA,CAACA,IAAIA,CAACA;QAChBA,CAACA;QAEMF,mBAAIA,GAAXA;YACIG,MAAMA,CAACA,IAAIA,CAACA;QAChBA,CAACA;QACLH,WAACA;IAADA,CAACA,AAbDD,IAaCA;IAbYA,eAAIA,OAahBA,CAAAA;AACFA,CAACA,EAfM,UAAU,KAAV,UAAU,QAehB;AChBD,kCAAkC;AAElC,IAAI,MAAM,GAAG,IAAI,UAAU,CAAC,IAAI,EAAE,CAAA;AAClC,MAAM,CAAC,KAAK,EAAE,CAAC;AACf,MAAM,CAAC,IAAI,EAAE,CAAC"} -------------------------------------------------------------------------------- /examples/basic_browser_project/built/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Basic Typescript Example 5 | 6 | 7 | 8 |

Compile to single file

9 |

Make .map files for debugging using the original typescript source. Try it using your browsers developer tools.

10 |

Countdown to insanity:

11 |

To stop the insanity or the countdown, type countdown_helper.stop() into the js console.

12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /examples/basic_browser_project/src/main2.ts: -------------------------------------------------------------------------------- 1 | 2 | // this is another source file 3 | // there are no references to this file from other files mentioned in tsconfig.json[files] 4 | // -> so this file has to be mentioned in tsconfig.json[files] to be compiled 5 | 6 | // in contrast: insanity.ts is compiled automatically, because it is referenced in main.ts 7 | // but it would be no harm, if insanity.ts would also be mentioned in tsconfig.json 8 | 9 | // just make sure, you will use something like document.ready(function() {}) as 10 | // an entry point for your code, if you have a larger codebase 11 | 12 | (window).main_two_has_been_executed = true; -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # Authors, sorted by whether or not they are me 2 | Isaac Z. Schlueter 3 | Brian Cottingham 4 | Carlos Brito Lage 5 | Jesse Dailey 6 | Kevin O'Hara 7 | Marco Rogers 8 | Mark Cavage 9 | Marko Mikulicic 10 | Nathan Rajlich 11 | Satheesh Natesan 12 | Trent Mick 13 | ashleybrener 14 | n4kz 15 | -------------------------------------------------------------------------------- /examples/amd_modules_with_tests/res/test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | hello! 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | -------------------------------------------------------------------------------- /messages/0.6.0.txt: -------------------------------------------------------------------------------- 1 | v0.6.0 2 | ------ 3 | 4 | tl;dr: required config file tsconfig.json. -> README 5 | 6 | 7 | - many internal changes. Report issues @ github. 8 | 9 | - Dropped: .sublimets config file, config in x.sublime-project 10 | 11 | - Now: 12 | - Compiler related config -> tsconfig.json (REQUIRED) 13 | - linting of tsconfig.json 14 | - There is a WIZZARD if no tsconfig.json is found 15 | - Other config -> multiple allowed places. Refer to README! 16 | 17 | - Compiler priority: 18 | 1. Setting: tsc_path 19 | 2. Search for typescript in your projects node_modules 20 | 3. Use compiler supplied with ArcticTypescript (pre 1.5 (beta)) (should be fine) 21 | 22 | - README rewrite 23 | 24 | - PRO Users: take a look at filesGlob feature (-> README) 25 | -------------------------------------------------------------------------------- /examples/common_js_modules_with_tests/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CommonJsExample", 3 | "version": "0.1.0", 4 | "release": "", 5 | "description": "Just an example for mocha, chai, sinon using commonjs modules", 6 | "author": "Phaiax, ArcticTypescript", 7 | "logo": "", 8 | "homepage": "https://github.com/Phaiax/ArcticTypescript/tree/master/examples", 9 | "bugs": "", 10 | "license": "Public Domain", 11 | "licenseUrl": "", 12 | "repository": { 13 | "type": "git", 14 | "url": "" 15 | }, 16 | "scripts": { 17 | "test": "NODE_ENV=test grunt jshint" 18 | }, 19 | "keywords": [ 20 | "example", 21 | "typescript" 22 | ], 23 | "dependencies": { 24 | }, 25 | "devDependencies": { 26 | "mocha": "*", 27 | "chai": "*" 28 | } 29 | } -------------------------------------------------------------------------------- /messages/0.5.0.txt: -------------------------------------------------------------------------------- 1 | v0.5.0 2 | ------ 3 | 4 | tldr: new configfile tsconfig.json. There will be a popup if you are affected. 5 | 6 | 7 | - autocompletion and error view will use the Typescript head version, 8 | the unreleased Typescript 1.5 beta 9 | - autocompletion and error view will now be initialized using tsconfig.json 10 | - you need to create a tsconfig.json inside of your source folder 11 | or some parent folder. Example config: 12 | 13 | { "compilerOptions" : { "target" : "es5", "module" : "commonjs" } } 14 | 15 | - refer to https://www.npmjs.com/package/tsconfig for more options. 16 | - for now, you need to manage both configs in parallel, since the 17 | old config is still used for the build system. 18 | - In the FOLLOWING releases, there will be another change which eliminates 19 | the need for root files and the old config structure. 20 | 21 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/node_modules/minimatch/test/brace-expand.js: -------------------------------------------------------------------------------- 1 | var tap = require("tap") 2 | , minimatch = require("../") 3 | 4 | tap.test("brace expansion", function (t) { 5 | // [ pattern, [expanded] ] 6 | ; [ [ "a{b,c{d,e},{f,g}h}x{y,z}" 7 | , [ "abxy" 8 | , "abxz" 9 | , "acdxy" 10 | , "acdxz" 11 | , "acexy" 12 | , "acexz" 13 | , "afhxy" 14 | , "afhxz" 15 | , "aghxy" 16 | , "aghxz" ] ] 17 | , [ "a{1..5}b" 18 | , [ "a1b" 19 | , "a2b" 20 | , "a3b" 21 | , "a4b" 22 | , "a5b" ] ] 23 | , [ "a{b}c", ["a{b}c"] ] 24 | ].forEach(function (tc) { 25 | var p = tc[0] 26 | , expect = tc[1] 27 | t.equivalent(minimatch.braceExpand(p), expect, p) 28 | }) 29 | console.error("ending") 30 | t.end() 31 | }) 32 | 33 | 34 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js: -------------------------------------------------------------------------------- 1 | var test = require('tap').test 2 | var sigmund = require('../sigmund.js') 3 | 4 | 5 | // occasionally there are duplicates 6 | // that's an acceptable edge-case. JSON.stringify and util.inspect 7 | // have some collision potential as well, though less, and collision 8 | // detection is expensive. 9 | var hash = '{abc/def/g{0h1i2{jkl' 10 | var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]} 11 | var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']} 12 | 13 | var obj3 = JSON.parse(JSON.stringify(obj1)) 14 | obj3.c = /def/ 15 | obj3.g[2].cycle = obj3 16 | var cycleHash = '{abc/def/g{0h1i2{jklcycle' 17 | 18 | test('basic', function (t) { 19 | t.equal(sigmund(obj1), hash) 20 | t.equal(sigmund(obj2), hash) 21 | t.equal(sigmund(obj3), cycleHash) 22 | t.end() 23 | }) 24 | 25 | -------------------------------------------------------------------------------- /examples/amd_modules_with_tests/src/tests/utilstest.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | 6 | 7 | 8 | var expect = chai.expect; 9 | 10 | import U = require("../utils/utils"); 11 | 12 | export var declare = function() { 13 | 14 | describe('Utils tests (TotalBasicUtils)', function(){ 15 | describe('#a()', function(){ 16 | it('should return a', function(){ 17 | expect('a').to.equal(U.TotalBasicUtils.a()); 18 | }); 19 | }); 20 | describe('#b()', function(){ 21 | it('should return b', function(){ 22 | expect('b').to.equal((new U.TotalBasicUtils()).b()); 23 | }); 24 | }); 25 | 26 | 27 | }); 28 | }; 29 | 30 | 31 | -------------------------------------------------------------------------------- /bin/node_modules/typescript/CopyrightNotice.txt: -------------------------------------------------------------------------------- 1 | /*! ***************************************************************************** 2 | Copyright (c) Microsoft Corporation. All rights reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | this file except in compliance with the License. You may obtain a copy of the 5 | License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 8 | KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 9 | WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 10 | MERCHANTABLITY OR NON-INFRINGEMENT. 11 | 12 | See the Apache Version 2.0 License for specific language governing permissions 13 | and limitations under the License. 14 | ***************************************************************************** */ 15 | 16 | -------------------------------------------------------------------------------- /examples/using_commonjs_modules/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "CommonJsExample", 3 | "version": "0.1.0", 4 | "release": "", 5 | "description": "Just an example for mocha, chai, sinon using commonjs modules", 6 | "author": "Phaiax, ArcticTypescript", 7 | "logo": "", 8 | "homepage": "https://github.com/Phaiax/ArcticTypescript/tree/master/examples", 9 | "bugs": "", 10 | "license": "Public Domain", 11 | "licenseUrl": "", 12 | "repository": { 13 | "type": "git", 14 | "url": "" 15 | }, 16 | "scripts": { 17 | "test": "NODE_ENV=test grunt jshint" 18 | }, 19 | "keywords": [ 20 | "example", 21 | "typescript" 22 | ], 23 | "dependencies": { 24 | "typescript": "git+ssh://git@github.com:Microsoft/TypeScript.git", 25 | }, 26 | "devDependencies": { 27 | "mocha": "*", 28 | "chai": "*" 29 | } 30 | } -------------------------------------------------------------------------------- /examples/amd_modules_with_tests/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "AmdModulesWithTests", 3 | "version": "0.1.0", 4 | "release": "", 5 | "description": "Just an example for mocha, chai, sinon using amd modules", 6 | "author": "Phaiax, ArcticTypescript", 7 | "logo": "", 8 | "homepage": "https://github.com/Phaiax/ArcticTypescript/tree/master/examples", 9 | "bugs": "", 10 | "license": "Public Domain", 11 | "licenseUrl": "", 12 | "repository": { 13 | "type": "git", 14 | "url": "" 15 | }, 16 | "scripts": { 17 | "test": "NODE_ENV=test grunt jshint" 18 | }, 19 | "keywords": [ 20 | "example", 21 | "typescript" 22 | ], 23 | "dependencies": { 24 | "requirejs": "*", 25 | "grunt": "*", 26 | "grunt-contrib-copy": "*" 27 | }, 28 | "devDependencies": { 29 | "mocha": "*", 30 | "chai": "*" 31 | } 32 | } -------------------------------------------------------------------------------- /lib/utils/CancelCommand.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | from .debug import Debug 4 | from .disabling import is_plugin_temporarily_disabled 5 | 6 | # CANCEL COMMAND EXCEPTION 7 | class CancelCommand(Exception): 8 | """ Throw this exception in a command. The decorator 9 | catch_CancelCommand will catch it and cancel silently """ 10 | pass 11 | 12 | # CANCEL COMMAND EXCEPTION CATCHER DECORATOR 13 | def catch_CancelCommand(func): 14 | """ Decorate every command with this one. It will check for 15 | the plugin disabled flag and catch CancelCommand exceptins. """ 16 | 17 | def catcher(*kargs, **kwargs): 18 | if is_plugin_temporarily_disabled(): 19 | return # do not execute command 20 | try: 21 | return func(*kargs, **kwargs) 22 | except CancelCommand: 23 | Debug('command', "A COMMAND WAS CANCELED") 24 | return False 25 | return catcher -------------------------------------------------------------------------------- /Comments.tmPreferences: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | name 6 | Comments 7 | scope 8 | source.ts 9 | settings 10 | 11 | shellVariables 12 | 13 | 14 | name 15 | TM_COMMENT_START 16 | value 17 | // 18 | 19 | 20 | name 21 | TM_COMMENT_START_2 22 | value 23 | /* 24 | 25 | 26 | name 27 | TM_COMMENT_END_2 28 | value 29 | */ 30 | 31 | 32 | 33 | uuid 34 | A67A8BD9-A951-406F-9175-018DD4B52FD1 35 | 36 | 37 | -------------------------------------------------------------------------------- /lib/display/Panel.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | 4 | 5 | class Panel(object): 6 | 7 | panel = None 8 | 9 | def show(self,window): 10 | self.window = window 11 | if not self.panel: 12 | self.panel = self.create_output_panel(self.window,'typescript_output') 13 | 14 | def hide(self): 15 | self.window.run_command("hide_panel", {"panel": "output.typescript_output"}) 16 | 17 | def update(self,output): 18 | self.panel.run_command('append', {'characters': output}) 19 | self.panel.show(self.panel.size()-1) 20 | self.window.run_command("show_panel", {"panel": "output.typescript_output"}) 21 | 22 | def clear(self,window): 23 | self.window = window 24 | self.panel = self.create_output_panel(self.window,'typescript_output') 25 | 26 | def create_output_panel(self,window,name): 27 | return window.create_output_panel(name) 28 | 29 | 30 | # --------------------------------------- INITIALISATION -------------------------------------- # 31 | 32 | PANEL = Panel() -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/node_modules/inherits/inherits.js: -------------------------------------------------------------------------------- 1 | module.exports = inherits 2 | 3 | function inherits (c, p, proto) { 4 | proto = proto || {} 5 | var e = {} 6 | ;[c.prototype, proto].forEach(function (s) { 7 | Object.getOwnPropertyNames(s).forEach(function (k) { 8 | e[k] = Object.getOwnPropertyDescriptor(s, k) 9 | }) 10 | }) 11 | c.prototype = Object.create(p.prototype, e) 12 | c.super = p 13 | } 14 | 15 | //function Child () { 16 | // Child.super.call(this) 17 | // console.error([this 18 | // ,this.constructor 19 | // ,this.constructor === Child 20 | // ,this.constructor.super === Parent 21 | // ,Object.getPrototypeOf(this) === Child.prototype 22 | // ,Object.getPrototypeOf(Object.getPrototypeOf(this)) 23 | // === Parent.prototype 24 | // ,this instanceof Child 25 | // ,this instanceof Parent]) 26 | //} 27 | //function Parent () {} 28 | //inherits(Child, Parent) 29 | //new Child 30 | -------------------------------------------------------------------------------- /snippets/snippetlist.sublime-snippet: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | * do : do while loop 14 | * for : for (…; i++) {…\} 15 | * forl : for (… .length; i++) {…\} 16 | * forb : for (…; i--) {…\} backwards loop (faster?) 17 | * forin: for … in … loop 18 | 19 | * f : function a(b) {c\} 20 | * r0 : return false; 21 | * r1 : return true; 22 | * ret : return a; 23 | 24 | * ie : if … else … 25 | * if : if … 26 | * log : console.log(); 27 | 28 | * to : setTimeout(() => {\}, 500); 29 | * sw : switch … case: … default: 30 | * thr : throw ""; */} 31 | ]]> 32 | typescriptsnippets 33 | source.ts 34 | Print all snippets for reference 35 | -------------------------------------------------------------------------------- /TODO.md: -------------------------------------------------------------------------------- 1 | 2 | TODO 3 | ==== 4 | 5 | hard 6 | ---- 7 | 8 | 9 | good to have 10 | ------------ 11 | 12 | * test build filew view without dir and outDir 13 | 14 | features 15 | -------- 16 | 17 | * tsserver 18 | + refactoring 19 | + formatting 20 | * multiple window fixes 21 | * Glob expand before build 22 | * build file live change (some utf error with autofilename) 23 | 24 | DONE 25 | ==== 26 | 27 | * first error calculation 28 | * error list has crude messages if a missing element of an object is selected 29 | * add all! compilerOptions 30 | * Lint tsconfig before opening project (-> done automatically but without real linter) 31 | * Open wizzard on tsconfig error 32 | * filesGlob 33 | * check parent dir in wizzard for tsfile generation 34 | * snippets -> Readme, AutoFilePath -> Readme 35 | * no exceptions if tsconfig json error during init 36 | * tsconfig validation 37 | * is Build output working? 38 | * replace all print() with Debug('nofity') 39 | * Code-Completion. Replaced arguments are shitty 40 | * Test: Deactivate Build system (on_query_key=>False when disabled??) -------------------------------------------------------------------------------- /examples/common_js_modules_with_tests/built/test/utilstest.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | var U = require("../utils/utils"); 6 | var chai = require('chai'); 7 | var expect = chai.expect; 8 | describe('Array', function () { 9 | describe('#indexOf()', function () { 10 | it('should return -1 when the value is not present', function () { 11 | expect(-1).to.equal([1, 2, 3].indexOf(5)); 12 | expect(-1).to.equal([1, 2, 3].indexOf(0)); 13 | }); 14 | }); 15 | }); 16 | describe('Utils tests (TotalBasicUtils)', function () { 17 | describe('#a()', function () { 18 | it('should return a', function () { 19 | expect('a').to.equal(U.TotalBasicUtils.a()); 20 | }); 21 | }); 22 | describe('#b()', function () { 23 | it('should return b', function () { 24 | expect('b').to.equal((new U.TotalBasicUtils()).b()); 25 | }); 26 | }); 27 | }); 28 | -------------------------------------------------------------------------------- /examples/common_js_modules_with_tests/src/test/utilstest.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | /// 5 | 6 | 7 | 8 | import U = require("../utils/utils"); 9 | import chai = require('chai'); 10 | var expect = chai.expect 11 | 12 | describe('Array', function(){ 13 | describe('#indexOf()', function(){ 14 | it('should return -1 when the value is not present', function(){ 15 | expect(-1).to.equal([1,2,3].indexOf(5)); 16 | expect(-1).to.equal([1,2,3].indexOf(0)); 17 | }) 18 | }) 19 | }) 20 | 21 | 22 | describe('Utils tests (TotalBasicUtils)', function(){ 23 | describe('#a()', function(){ 24 | it('should return a', function(){ 25 | expect('a').to.equal(U.TotalBasicUtils.a()); 26 | }); 27 | }); 28 | describe('#b()', function(){ 29 | it('should return b', function(){ 30 | expect('b').to.equal((new U.TotalBasicUtils()).b()); 31 | }); 32 | }); 33 | }); 34 | 35 | 36 | -------------------------------------------------------------------------------- /examples/amd_modules_with_tests/res/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | hello 6 | 7 | 8 | 9 | 10 |
11 | 12 |

This is an example for a typescript project in a browser, using 13 | require.js and amd modules.

14 | 15 |

execute

npm install
to install all dependencies

16 | 17 |

A test system is included.

18 | 19 |

You must compile the sources and execute the gruntfile. This will copy the files from the

res/
folder to the
built/
folder, from where you can open
index.html
and
test.html
afterwards.

20 | 21 |

If you open this file from the

res/
folder, it will not work

22 |
23 |
24 | 25 | -------------------------------------------------------------------------------- /LICENCE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Railk, Phaiax (phaiax-arctic{o}invisibletower.de) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node --expose_gc 2 | 3 | var weak = require('weak'); 4 | var test = require('tap').test 5 | var LRU = require('../') 6 | var l = new LRU({ max: 10 }) 7 | var refs = 0 8 | function X() { 9 | refs ++ 10 | weak(this, deref) 11 | } 12 | 13 | function deref() { 14 | refs -- 15 | } 16 | 17 | test('no leaks', function (t) { 18 | // fill up the cache 19 | for (var i = 0; i < 100; i++) { 20 | l.set(i, new X); 21 | // throw some gets in there, too. 22 | if (i % 2 === 0) 23 | l.get(i / 2) 24 | } 25 | 26 | gc() 27 | 28 | var start = process.memoryUsage() 29 | 30 | // capture the memory 31 | var startRefs = refs 32 | 33 | // do it again, but more 34 | for (var i = 0; i < 10000; i++) { 35 | l.set(i, new X); 36 | // throw some gets in there, too. 37 | if (i % 2 === 0) 38 | l.get(i / 2) 39 | } 40 | 41 | gc() 42 | 43 | var end = process.memoryUsage() 44 | t.equal(refs, startRefs, 'no leaky refs') 45 | 46 | console.error('start: %j\n' + 47 | 'end: %j', start, end); 48 | t.pass(); 49 | t.end(); 50 | }) 51 | -------------------------------------------------------------------------------- /Main.sublime-menu: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "caption": "Preferences", 4 | "mnemonic": "n", 5 | "id": "preferences", 6 | "children": 7 | [ 8 | { 9 | "caption": "Package Settings", 10 | "mnemonic": "P", 11 | "id": "package-settings", 12 | "children": 13 | [ 14 | { 15 | "caption": "ArcticTypescript", 16 | "children": 17 | [ 18 | { 19 | "command": "open_file", 20 | "args": {"file": "${packages}/ArcticTypescript/README.md"}, 21 | "caption": "README" 22 | }, 23 | { 24 | "command": "open_file", 25 | "args": {"file": "${packages}/ArcticTypescript/CHANGES.txt"}, 26 | "caption": "CHANGES" 27 | }, 28 | { 29 | "caption": "-" 30 | }, 31 | { 32 | "command": "open_file", 33 | "args": {"file": "${packages}/ArcticTypescript/ArcticTypescript.sublime-settings"}, 34 | "caption": "Settings – Default" 35 | }, 36 | { 37 | "command": "open_file", 38 | "args": {"file": "${packages}/User/ArcticTypescript.sublime-settings"}, 39 | "caption": "Settings – User" 40 | } 41 | ] 42 | } 43 | ] 44 | } 45 | ] 46 | } 47 | ] -------------------------------------------------------------------------------- /examples/amd_modules_with_tests/src/lib/sinon-chai/sinon-chai.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for sinon-chai 2.4.0 2 | // Project: https://github.com/domenic/sinon-chai 3 | // Definitions by: Kazi Manzur Rashid 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | /// 7 | 8 | declare module chai { 9 | interface Expect { 10 | called: Expect; 11 | calledOnce: Expect; 12 | calledTwice: Expect; 13 | calledThrice: Expect; 14 | calledBefore(spy: Function): Expect; 15 | calledAfter(spy: Function): Expect; 16 | calledWithNew: Expect; 17 | calledOn(context: any): Expect; 18 | calledWith(...args: any[]): Expect; 19 | calledWithExactly(...args: any[]): Expect; 20 | calledWithMatch(...args: any[]): Expect; 21 | returned(returnVal: any): Expect; 22 | thrown(errorObjOrErrorTypeStringOrNothing: any): Expect; 23 | } 24 | 25 | interface LanguageChains { 26 | always: Expect; 27 | } 28 | } 29 | 30 | declare module "sinon-chai" { 31 | function exports(_chai: typeof chai, utils: any): void; 32 | export = exports; 33 | } 34 | -------------------------------------------------------------------------------- /examples/common_js_modules_with_tests/src/lib/sinon-chai/sinon-chai.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for sinon-chai 2.4.0 2 | // Project: https://github.com/domenic/sinon-chai 3 | // Definitions by: Kazi Manzur Rashid 4 | // Definitions: https://github.com/borisyankov/DefinitelyTyped 5 | 6 | /// 7 | 8 | declare module chai { 9 | interface Expect { 10 | called: Expect; 11 | calledOnce: Expect; 12 | calledTwice: Expect; 13 | calledThrice: Expect; 14 | calledBefore(spy: Function): Expect; 15 | calledAfter(spy: Function): Expect; 16 | calledWithNew: Expect; 17 | calledOn(context: any): Expect; 18 | calledWith(...args: any[]): Expect; 19 | calledWithExactly(...args: any[]): Expect; 20 | calledWithMatch(...args: any[]): Expect; 21 | returned(returnVal: any): Expect; 22 | thrown(errorObjOrErrorTypeStringOrNothing: any): Expect; 23 | } 24 | 25 | interface LanguageChains { 26 | always: Expect; 27 | } 28 | } 29 | 30 | declare module "sinon-chai" { 31 | function exports(_chai: typeof chai, utils: any): void; 32 | export = exports; 33 | } 34 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/node_modules/minimatch/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2009, 2010, 2011 Isaac Z. Schlueter. 2 | All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person 5 | obtaining a copy of this software and associated documentation 6 | files (the "Software"), to deal in the Software without 7 | restriction, including without limitation the rights to use, 8 | copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | OTHER DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/test/root-nomount.js: -------------------------------------------------------------------------------- 1 | var tap = require("tap") 2 | 3 | var origCwd = process.cwd() 4 | process.chdir(__dirname) 5 | 6 | tap.test("changing root and searching for /b*/**", function (t) { 7 | var glob = require('../') 8 | var path = require('path') 9 | t.test('.', function (t) { 10 | glob('/b*/**', { globDebug: true, root: '.', nomount: true }, function (er, matches) { 11 | t.ifError(er) 12 | t.like(matches, []) 13 | t.end() 14 | }) 15 | }) 16 | 17 | t.test('a', function (t) { 18 | glob('/b*/**', { globDebug: true, root: path.resolve('a'), nomount: true }, function (er, matches) { 19 | t.ifError(er) 20 | t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) 21 | t.end() 22 | }) 23 | }) 24 | 25 | t.test('root=a, cwd=a/b', function (t) { 26 | glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b'), nomount: true }, function (er, matches) { 27 | t.ifError(er) 28 | t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ]) 29 | t.end() 30 | }) 31 | }) 32 | 33 | t.test('cd -', function (t) { 34 | process.chdir(origCwd) 35 | t.end() 36 | }) 37 | 38 | t.end() 39 | }) 40 | -------------------------------------------------------------------------------- /lib/test/test_utils.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | import sublime, sys, os 4 | 5 | from ArcticTypescript.lib.ArcticTestCase import ArcticTestCase 6 | from ArcticTypescript.lib.utils import get_deep, get_first 7 | from sublime_unittest import TestCase 8 | from unittest.mock import MagicMock as MM 9 | 10 | 11 | class test_project_opening(ArcticTestCase): 12 | 13 | 14 | def test_get_first(self): 15 | l = [{"e": 3}, {"e": 4}, {"e": 5}] 16 | r = get_first(l, lambda i: i['e'] == 4) 17 | self.assertEqual(r, l[1]) 18 | 19 | 20 | def test_get_from_objectstructure(self): 21 | l = {"a": { 22 | "aa": 5, 23 | "ab": [11, 22], 24 | "ac": { 25 | "aca": "v" 26 | } 27 | }} 28 | 29 | self.assertEqual(get_deep(l, "a"), l['a']) 30 | self.assertEqual(get_deep(l, "a:aa"), 5) 31 | self.assertEqual(get_deep(l, "a:ab"), l['a']['ab']) 32 | self.assertEqual(get_deep(l, "a:ab:1"), 22) 33 | self.assertRaises(KeyError, lambda: get_deep(l, "a:ab:2")) 34 | self.assertEqual(get_deep(l, "a:ac:aca"), l['a']['ac']['aca']) 35 | self.assertRaises(KeyError, lambda: get_deep(l, "a:ab:asd")) 36 | 37 | 38 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2009, 2010, 2011 Isaac Z. Schlueter. 2 | All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person 5 | obtaining a copy of this software and associated documentation 6 | files (the "Software"), to deal in the Software without 7 | restriction, including without limitation the rights to use, 8 | copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | OTHER DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /bin/refactor.js: -------------------------------------------------------------------------------- 1 | // IMPORT 2 | var fs = require('fs'); 3 | 4 | 5 | // VARS 6 | var FILE_ENCODING = 'utf-8'; 7 | var replace = process.argv[2]; 8 | var refs = JSON.parse(process.argv[3]); 9 | 10 | // STRING REPLACE AT 11 | String.prototype.replaceAt=function(index,length, str) { 12 | return this.substr(0, index) + str + this.substr(index+length); 13 | }; 14 | 15 | function encode(message){ 16 | return JSON.stringify(message); 17 | } 18 | 19 | function get_chars(out,num_lines){ 20 | lines = out.split('\n'); 21 | chars = 0; 22 | for (var i = 0; i < num_lines-1; i++) { 23 | chars += lines[i].length+1; 24 | } 25 | return chars; 26 | } 27 | 28 | var output = ""; 29 | 30 | // REPLACE 31 | for (var i = 0; i < refs.length; i++) { 32 | var path = refs[i].ref.fileName; 33 | var out = fs.readFileSync(path, FILE_ENCODING); 34 | var index = get_chars(out,refs[i]['min']['line']) + refs[i]['min']['character']-1; 35 | var end = refs[i]['lim']['character'] - refs[i]['min']['character']; 36 | out = out.replaceAt(index,end,replace); 37 | fs.writeFileSync(path, out, FILE_ENCODING); 38 | 39 | console.log(encode({"file":path})); 40 | output += '\n'+path+' ('+index+','+end+')'; 41 | } 42 | 43 | console.log(encode({"output":"Typescript refactor finished, the following files have been modified :\n"+ output})); -------------------------------------------------------------------------------- /lib/display/Message.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | import sublime 4 | from ..utils.debounce import debounce 5 | 6 | class Message(object): 7 | 8 | messages =[] 9 | 10 | def show(self, message, hide=False, with_panel=True): 11 | self.messages = [] 12 | self.messages.append(message) 13 | 14 | if with_panel: 15 | window = sublime.active_window() 16 | window.run_command("hide_overlay") 17 | window.show_quick_panel(self.messages, self.hide) 18 | sublime.status_message(message) 19 | 20 | if hide: 21 | debounce(self.hide, 1, 'message' + str(id(MESSAGE))) 22 | 23 | 24 | def repeat(self, message, with_panel=True): 25 | self.messages = [] 26 | self.messages.append(message) 27 | 28 | 29 | if with_panel: 30 | window = sublime.active_window() 31 | window.run_command("hide_overlay") 32 | window.show_quick_panel(self.messages, self.hide) 33 | 34 | sublime.status_message(message) 35 | 36 | 37 | def hide(self,index=None): 38 | sublime.active_window().run_command("hide_overlay") 39 | sublime.status_message('') 40 | 41 | # --------------------------------------- INITIALISATION -------------------------------------- # 42 | 43 | MESSAGE = Message() -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/test/root.js: -------------------------------------------------------------------------------- 1 | var t = require("tap") 2 | 3 | var origCwd = process.cwd() 4 | process.chdir(__dirname) 5 | 6 | var glob = require('../') 7 | var path = require('path') 8 | 9 | t.test('.', function (t) { 10 | glob('/b*/**', { globDebug: true, root: '.' }, function (er, matches) { 11 | t.ifError(er) 12 | t.like(matches, []) 13 | t.end() 14 | }) 15 | }) 16 | 17 | 18 | t.test('a', function (t) { 19 | console.error("root=" + path.resolve('a')) 20 | glob('/b*/**', { globDebug: true, root: path.resolve('a') }, function (er, matches) { 21 | t.ifError(er) 22 | var wanted = [ 23 | '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' 24 | ].map(function (m) { 25 | return path.join(path.resolve('a'), m).replace(/\\/g, '/') 26 | }) 27 | 28 | t.like(matches, wanted) 29 | t.end() 30 | }) 31 | }) 32 | 33 | t.test('root=a, cwd=a/b', function (t) { 34 | glob('/b*/**', { globDebug: true, root: 'a', cwd: path.resolve('a/b') }, function (er, matches) { 35 | t.ifError(er) 36 | t.like(matches, [ '/b', '/b/c', '/b/c/d', '/bc', '/bc/e', '/bc/e/f' ].map(function (m) { 37 | return path.join(path.resolve('a'), m).replace(/\\/g, '/') 38 | })) 39 | t.end() 40 | }) 41 | }) 42 | 43 | t.test('cd -', function (t) { 44 | process.chdir(origCwd) 45 | t.end() 46 | }) 47 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/node_modules/graceful-fs/test/open.js: -------------------------------------------------------------------------------- 1 | var test = require('tap').test 2 | var fs = require('../graceful-fs.js') 3 | 4 | test('graceful fs is not fs', function (t) { 5 | t.notEqual(fs, require('fs')) 6 | t.end() 7 | }) 8 | 9 | test('open an existing file works', function (t) { 10 | var start = fs._curOpen 11 | var fd = fs.openSync(__filename, 'r') 12 | t.equal(fs._curOpen, start + 1) 13 | fs.closeSync(fd) 14 | t.equal(fs._curOpen, start) 15 | fs.open(__filename, 'r', function (er, fd) { 16 | if (er) throw er 17 | t.equal(fs._curOpen, start + 1) 18 | fs.close(fd, function (er) { 19 | if (er) throw er 20 | t.equal(fs._curOpen, start) 21 | t.end() 22 | }) 23 | }) 24 | }) 25 | 26 | test('open a non-existing file throws', function (t) { 27 | var start = fs._curOpen 28 | var er 29 | try { 30 | var fd = fs.openSync('this file does not exist', 'r') 31 | } catch (x) { 32 | er = x 33 | } 34 | t.ok(er, 'should throw') 35 | t.notOk(fd, 'should not get an fd') 36 | t.equal(er.code, 'ENOENT') 37 | t.equal(fs._curOpen, start) 38 | 39 | fs.open('neither does this file', 'r', function (er, fd) { 40 | t.ok(er, 'should throw') 41 | t.notOk(fd, 'should not get an fd') 42 | t.equal(er.code, 'ENOENT') 43 | t.equal(fs._curOpen, start) 44 | t.end() 45 | }) 46 | }) 47 | -------------------------------------------------------------------------------- /lib/tsconfiglint/TsconfigListener.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | import sublime 4 | import sublime_plugin 5 | 6 | import os 7 | 8 | from .TsconfigLinter import check_tsconfig, show_lint_in_status 9 | from .tsconfigglobexpand import expand_filesglob 10 | from ..utils.CancelCommand import catch_CancelCommand, CancelCommand 11 | from ..system.Project import opened_project_by_tsconfig 12 | 13 | class TsconfigEventListener(sublime_plugin.EventListener): 14 | """ Listen to file events -> Activate TsconfigLinter. 15 | check_tsconfig immediately returns if file is no tsconfig.json """ 16 | 17 | def on_activated_async(self, view): 18 | check_tsconfig(view) 19 | 20 | 21 | def on_load_async(self, view): 22 | check_tsconfig(view) 23 | 24 | 25 | def on_modified(self, view): 26 | check_tsconfig(view) 27 | 28 | 29 | def on_clone_async(self, view): 30 | check_tsconfig(view) 31 | 32 | 33 | @catch_CancelCommand 34 | def on_post_save_async(self, view): 35 | linter = check_tsconfig(view) 36 | linting_succeeded = expand_filesglob(linter) 37 | if linting_succeeded: 38 | project = opened_project_by_tsconfig(linter.file_name) 39 | if project: 40 | project.reopen_project() 41 | 42 | 43 | def on_selection_modified_async(self, view): 44 | show_lint_in_status(view) 45 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/foreach.js: -------------------------------------------------------------------------------- 1 | var test = require('tap').test 2 | var LRU = require('../') 3 | 4 | test('forEach', function (t) { 5 | var l = new LRU(5) 6 | for (var i = 0; i < 10; i ++) { 7 | l.set(i.toString(), i.toString(2)) 8 | } 9 | 10 | var i = 9 11 | l.forEach(function (val, key, cache) { 12 | t.equal(cache, l) 13 | t.equal(key, i.toString()) 14 | t.equal(val, i.toString(2)) 15 | i -= 1 16 | }) 17 | 18 | // get in order of most recently used 19 | l.get(6) 20 | l.get(8) 21 | 22 | var order = [ 8, 6, 9, 7, 5 ] 23 | var i = 0 24 | 25 | l.forEach(function (val, key, cache) { 26 | var j = order[i ++] 27 | t.equal(cache, l) 28 | t.equal(key, j.toString()) 29 | t.equal(val, j.toString(2)) 30 | }) 31 | 32 | t.end() 33 | }) 34 | 35 | test('keys() and values()', function (t) { 36 | var l = new LRU(5) 37 | for (var i = 0; i < 10; i ++) { 38 | l.set(i.toString(), i.toString(2)) 39 | } 40 | 41 | t.similar(l.keys(), ['9', '8', '7', '6', '5']) 42 | t.similar(l.values(), ['1001', '1000', '111', '110', '101']) 43 | 44 | // get in order of most recently used 45 | l.get(6) 46 | l.get(8) 47 | 48 | t.similar(l.keys(), ['8', '6', '9', '7', '5']) 49 | t.similar(l.values(), ['1000', '110', '1001', '111', '101']) 50 | 51 | t.end() 52 | }) 53 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/node_modules/inherits/README.md: -------------------------------------------------------------------------------- 1 | A dead simple way to do inheritance in JS. 2 | 3 | var inherits = require("inherits") 4 | 5 | function Animal () { 6 | this.alive = true 7 | } 8 | Animal.prototype.say = function (what) { 9 | console.log(what) 10 | } 11 | 12 | inherits(Dog, Animal) 13 | function Dog () { 14 | Dog.super.apply(this) 15 | } 16 | Dog.prototype.sniff = function () { 17 | this.say("sniff sniff") 18 | } 19 | Dog.prototype.bark = function () { 20 | this.say("woof woof") 21 | } 22 | 23 | inherits(Chihuahua, Dog) 24 | function Chihuahua () { 25 | Chihuahua.super.apply(this) 26 | } 27 | Chihuahua.prototype.bark = function () { 28 | this.say("yip yip") 29 | } 30 | 31 | // also works 32 | function Cat () { 33 | Cat.super.apply(this) 34 | } 35 | Cat.prototype.hiss = function () { 36 | this.say("CHSKKSS!!") 37 | } 38 | inherits(Cat, Animal, { 39 | meow: function () { this.say("miao miao") } 40 | }) 41 | Cat.prototype.purr = function () { 42 | this.say("purr purr") 43 | } 44 | 45 | 46 | var c = new Chihuahua 47 | assert(c instanceof Chihuahua) 48 | assert(c instanceof Dog) 49 | assert(c instanceof Animal) 50 | 51 | The actual function is laughably small. 10-lines small. 52 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/node_modules/minimatch/node_modules/sigmund/sigmund.js: -------------------------------------------------------------------------------- 1 | module.exports = sigmund 2 | function sigmund (subject, maxSessions) { 3 | maxSessions = maxSessions || 10; 4 | var notes = []; 5 | var analysis = ''; 6 | var RE = RegExp; 7 | 8 | function psychoAnalyze (subject, session) { 9 | if (session > maxSessions) return; 10 | 11 | if (typeof subject === 'function' || 12 | typeof subject === 'undefined') { 13 | return; 14 | } 15 | 16 | if (typeof subject !== 'object' || !subject || 17 | (subject instanceof RE)) { 18 | analysis += subject; 19 | return; 20 | } 21 | 22 | if (notes.indexOf(subject) !== -1 || session === maxSessions) return; 23 | 24 | notes.push(subject); 25 | analysis += '{'; 26 | Object.keys(subject).forEach(function (issue, _, __) { 27 | // pseudo-private values. skip those. 28 | if (issue.charAt(0) === '_') return; 29 | var to = typeof subject[issue]; 30 | if (to === 'function' || to === 'undefined') return; 31 | analysis += issue; 32 | psychoAnalyze(subject[issue], session + 1); 33 | }); 34 | } 35 | psychoAnalyze(subject, 0); 36 | return analysis; 37 | } 38 | 39 | // vim: set softtabstop=4 shiftwidth=4: 40 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/node_modules/graceful-fs/README.md: -------------------------------------------------------------------------------- 1 | # graceful-fs 2 | 3 | graceful-fs functions as a drop-in replacement for the fs module, 4 | making various improvements. 5 | 6 | The improvements are meant to normalize behavior across different 7 | platforms and environments, and to make filesystem access more 8 | resilient to errors. 9 | 10 | ## Improvements over fs module 11 | 12 | graceful-fs: 13 | 14 | * keeps track of how many file descriptors are open, and by default 15 | limits this to 1024. Any further requests to open a file are put in a 16 | queue until new slots become available. If 1024 turns out to be too 17 | much, it decreases the limit further. 18 | * fixes `lchmod` for Node versions prior to 0.6.2. 19 | * implements `fs.lutimes` if possible. Otherwise it becomes a noop. 20 | * ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or 21 | `lchown` if the user isn't root. 22 | * makes `lchmod` and `lchown` become noops, if not available. 23 | * retries reading a file if `read` results in EAGAIN error. 24 | 25 | On Windows, it retries renaming a file for up to one second if `EACCESS` 26 | or `EPERM` error occurs, likely because antivirus software has locked 27 | the directory. 28 | 29 | ## Configuration 30 | 31 | The maximum number of open file descriptors that graceful-fs manages may 32 | be adjusted by setting `fs.MAX_OPEN` to a different number. The default 33 | is 1024. 34 | -------------------------------------------------------------------------------- /TESTING.md: -------------------------------------------------------------------------------- 1 | 2 | #Introduction 3 | 4 | This is a short reference on how to test this plugin in a TDD way. 5 | 6 | This plugin uses https://packagecontrol.io/packages/UnitTesting for testing itself. 7 | 8 | 9 | 10 | # Preparations 11 | 12 | Just for clarity: For development, do not install ArcticTypescript via Package Control. Instead install it into the "Packages" directory via git clone. 13 | 14 | * Install randy3k's UnitTesting via Package Control 15 | * Install Restart via Package Control 16 | * Install "Plugin UnitTest Harness" via Package Control 17 | * You may change the Keycode F5 for restart, since it interferes with ArcticTypescript at the moment 18 | 19 | 20 | The Tests modify the project file on the fly, so best you open the TDDTesting Project. 21 | 22 | * Project -> Close Project 23 | * restart sublime 24 | * Project -> Open Project -> ArcticTypescript/tests/TDDTesting/TDDTesting.sublime-project 25 | 26 | # TDD 27 | 28 | Now every time that you restart sublime, it will execute the tests in lib/test and display the results. 29 | 30 | Press F5 to restart sublime. 31 | 32 | See any tests as examples on how to test. 33 | 34 | To limit the executed tests, edit the filepattern parameter in ArcticTypescript.py. Do not commit changes done here. 35 | 36 | # TODO 37 | 38 | To be able to test different configurations, we must implement complete unloading of a loaded Typescript Project (no more globals!) 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Isaac Z. Schlueter ("Author") 2 | All rights reserved. 3 | 4 | The BSD License 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright 14 | notice, this list of conditions and the following disclaimer in the 15 | documentation and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS 21 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 | IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/node_modules/graceful-fs/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Isaac Z. Schlueter ("Author") 2 | All rights reserved. 3 | 4 | The BSD License 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright 14 | notice, this list of conditions and the following disclaimer in the 15 | documentation and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS 21 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 | IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/test/cwd-test.js: -------------------------------------------------------------------------------- 1 | var tap = require("tap") 2 | 3 | var origCwd = process.cwd() 4 | process.chdir(__dirname) 5 | 6 | tap.test("changing cwd and searching for **/d", function (t) { 7 | var glob = require('../') 8 | var path = require('path') 9 | t.test('.', function (t) { 10 | glob('**/d', function (er, matches) { 11 | t.ifError(er) 12 | t.like(matches, [ 'a/b/c/d', 'a/c/d' ]) 13 | t.end() 14 | }) 15 | }) 16 | 17 | t.test('a', function (t) { 18 | glob('**/d', {cwd:path.resolve('a')}, function (er, matches) { 19 | t.ifError(er) 20 | t.like(matches, [ 'b/c/d', 'c/d' ]) 21 | t.end() 22 | }) 23 | }) 24 | 25 | t.test('a/b', function (t) { 26 | glob('**/d', {cwd:path.resolve('a/b')}, function (er, matches) { 27 | t.ifError(er) 28 | t.like(matches, [ 'c/d' ]) 29 | t.end() 30 | }) 31 | }) 32 | 33 | t.test('a/b/', function (t) { 34 | glob('**/d', {cwd:path.resolve('a/b/')}, function (er, matches) { 35 | t.ifError(er) 36 | t.like(matches, [ 'c/d' ]) 37 | t.end() 38 | }) 39 | }) 40 | 41 | t.test('.', function (t) { 42 | glob('**/d', {cwd: process.cwd()}, function (er, matches) { 43 | t.ifError(er) 44 | t.like(matches, [ 'a/b/c/d', 'a/c/d' ]) 45 | t.end() 46 | }) 47 | }) 48 | 49 | t.test('cd -', function (t) { 50 | process.chdir(origCwd) 51 | t.end() 52 | }) 53 | 54 | t.end() 55 | }) 56 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/node_modules/minimatch/node_modules/sigmund/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Isaac Z. Schlueter ("Author") 2 | All rights reserved. 3 | 4 | The BSD License 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions 8 | are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright 14 | notice, this list of conditions and the following disclaimer in the 15 | documentation and/or other materials provided with the distribution. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS 21 | BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 | IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /examples/basic_browser_project/src/insanity.ts: -------------------------------------------------------------------------------- 1 | module Insanity { 2 | // it is allowed to split a single module across multiple files 3 | // so it would be fine to have other files with module Insanity {} 4 | 5 | var start_time: number = 21; 6 | 7 | export class CountdownToInsanity{ 8 | time_to_go: number; 9 | interval_id: number = null; 10 | insanity_intervall_id: number = null; 11 | bg_color_counter = 1; 12 | bg_colors: string[] = ['white', 'red', 'black', 'orange'] 13 | 14 | 15 | constructor(private element: HTMLElement){ 16 | } 17 | 18 | public start(){ 19 | this.time_to_go = start_time; 20 | this.interval_id = setInterval(() => { this.tick() }, 1000) 21 | } 22 | 23 | 24 | private tick() { 25 | this.time_to_go -= 1; 26 | this.element.innerHTML = this.time_to_go.toString(); 27 | if (this.time_to_go == 0) { 28 | this.stop(); 29 | this.start_insanity(); 30 | } 31 | } 32 | 33 | private start_insanity() { 34 | this.insanity_intervall_id = setInterval(() => { 35 | this.bg_color_counter = (this.bg_color_counter + 1) % this.bg_colors.length; 36 | document.body.style['background-color'] = this.bg_colors[this.bg_color_counter]; 37 | }, 100); 38 | } 39 | 40 | public stop(){ 41 | if (this.interval_id) { 42 | clearInterval(this.interval_id); 43 | this.interval_id = null; 44 | } 45 | if (this.insanity_intervall_id) { 46 | clearInterval(this.insanity_intervall_id); 47 | this.insanity_intervall_id = null; 48 | } 49 | } 50 | 51 | } 52 | } -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/readme.md: -------------------------------------------------------------------------------- 1 | # glob-expand 2 | 3 | A (sync) glob / minimatch / RegExp call using [gruntjs](https://github.com/gruntjs/grunt)'s `file.expand`. 4 | 5 | It has only a minimum of dependencies (glob & lodash). 6 | 7 | Its almost a copy/paste of 2 functions from Gruntjs's v0.4.1 [grunt/file.js](https://github.com/gruntjs/grunt/blob/master/lib/grunt/file.js) 8 | 9 | Additionally you can use [minimatch](http://github.com/isaacs/minimatch/) `String`s or `RegExp`s, either as an Array or as arguments. 10 | * 11 | 12 | ## Install: 13 | 14 | `npm install glob-expand` 15 | 16 | ## Examples: 17 | ```coffeescript 18 | expand = require 'glob-expand' 19 | 20 | # may the original node-glob be with you (should you need it): 21 | glob = expand.glob 22 | 23 | expand {filter: 'isFile', cwd: '../'}, ['**/*.*', '!exclude/these/**/*.*'] 24 | # returns all files in cwd ['file1', 'file2',...] but excluding 25 | # those under directory 'exclude/these' 26 | 27 | # These are the same 28 | expand {cwd: '../..'}, ['**/*.*', '!node_modules/**/*.*'] 29 | expand {cwd: '../..'}, '**/*.*', '!node_modules/**/*.*' 30 | 31 | # These are the same too: 32 | expand {}, ['**/*.*', '!**/*.js'] 33 | expand {}, '**/*.*', '!**/*.js' 34 | expand ['**/*.*', '!**/*.js'] 35 | expand '**/*.*', '!**/*.js' 36 | 37 | # Using Regular Expressions: 38 | expand '**/*.js', /.*\.(coffee\.md|litcoffee|coffee)$/i, '!DRAFT*.*' 39 | # -> returns all `.js`, `.coffee`, `.coffee.md` & `.litcoffee` files, 40 | # excluding those starting with 'DRAFT' 41 | 42 | ``` 43 | 44 | See [gruntjs files configuration](http://gruntjs.com/configuring-tasks#files) 45 | and [node-glob](https://github.com/isaacs/node-glob) for more options. 46 | 47 | Sorry no tests, I assumed gruntjs's tests are sufficient ;-) -------------------------------------------------------------------------------- /lib/system/busted/Liste.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | from ..Utils import fn2k 4 | 5 | class Liste(object): 6 | """ 7 | Liste keeps track of which file belongs to which rootfile. 8 | The global LISTE is managed by FILES, which uses the tss 'files' command 9 | 10 | Format of self.liste = 11 | { "/home/lowercased/file/path.ts" : 12 | { "refs" : [], root : "root file path", file : "/home/NOT/lowercased/file/path.ts" } 13 | } 14 | 15 | """ 16 | 17 | liste = {} 18 | 19 | def get_root(self,filename): 20 | """ return of file or None """ 21 | if not filename or not self.has(filename): 22 | return None 23 | return self.liste[fn2k(filename)]['root'] 24 | 25 | def get(self,filename): 26 | """ returns the { "refs": [], "root": , "file": } dictionary for filename """ 27 | return self.liste[fn2k(filename)] 28 | 29 | def has(self,filename): 30 | """ returns weather or not this instance contains filename """ 31 | return fn2k(filename) in self.liste 32 | 33 | def add(self,filename,data): 34 | """ adds or updates the dict for filename """ 35 | self.liste[fn2k(filename)] = data 36 | 37 | def remove(self,filename): 38 | """ removes filename from list """ 39 | del self.liste[fn2k(filename)] 40 | 41 | def remove_by_root(self, root_filename): 42 | """ remove all files which have this file as root file """ 43 | to_delete = [file for file in self.liste if self.get_root(file) == root_filename] 44 | 45 | for file in to_delete: 46 | del self.liste[file] 47 | 48 | # global 49 | LISTE = Liste() 50 | 51 | def get_root(filename): 52 | return LISTE.get_root(filename) 53 | 54 | -------------------------------------------------------------------------------- /Default.sublime-keymap: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "command": "typescript_completion", 4 | "keys": ["ctrl+space"], 5 | "context": [ {"key": "ArcticTypescript"} ] 6 | }, 7 | { 8 | "command": "typescript_error_panel", 9 | "keys": ["alt+shift+e", "alt+shift+e"], 10 | "context": [ {"key": "ArcticTypescript"} ] 11 | }, 12 | { 13 | "command": "typescript_error_goto", 14 | "keys": ["alt+shift+e", "alt+shift+h"], 15 | "args": {"n": 0 }, 16 | "context": [ {"key": "ArcticTypescript"} ] 17 | }, 18 | { 19 | "command": "typescript_error_goto", 20 | "keys": ["alt+shift+e", "alt+shift+j"], 21 | "args": {"n": 1 }, 22 | "context": [ {"key": "ArcticTypescript"} ] 23 | }, 24 | { 25 | "command": "typescript_error_goto", 26 | "keys": ["alt+shift+e", "alt+shift+k"], 27 | "args": {"n": 2 }, 28 | "context": [ {"key": "ArcticTypescript"} ] 29 | }, 30 | { 31 | "command": "typescript_error_goto", 32 | "keys": ["alt+shift+e", "alt+shift+l"], 33 | "args": {"n": 3 }, 34 | "context": [ {"key": "ArcticTypescript"} ] 35 | }, 36 | { 37 | "command": "typescript_reload_project", 38 | "keys": ["shift+f5"], 39 | "context": [ {"key": "ArcticTypescript"} ] 40 | }, 41 | { 42 | "command": "typescript_definition", 43 | "keys": ["f4"], 44 | "context": [ {"key": "ArcticTypescript"} ] 45 | }, 46 | { 47 | "command": "typescript_type", 48 | "keys": ["f1"], 49 | "context": [ {"key": "ArcticTypescript"} ] 50 | }, 51 | { 52 | "command": "typescript_refactor", 53 | "keys": ["f2"], 54 | "context": [ {"key": "ArcticTypescript"} ] 55 | }, 56 | { 57 | "command": "typescript_build", 58 | "args": {"characters": ""}, 59 | "keys": ["f8"], 60 | "context": [ {"key": "ArcticTypescriptBuild"} ] 61 | }, 62 | { 63 | "command": "typescript_build", 64 | "args": {"characters": ""}, 65 | "keys": ["ctrl+b"], 66 | "context": [ {"key": "ArcticTypescriptBuild"} ] 67 | } 68 | ] 69 | -------------------------------------------------------------------------------- /Default.sublime-commands: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "caption": "ArcticTypescript: Errors view", 4 | "command": "typescript_error_panel", 5 | "context": [ {"key": "ArcticTypescript"} ] 6 | }, 7 | { 8 | "caption": "ArcticTypescript: Go to first error", 9 | "command": "typescript_error_goto", 10 | "context": [ {"key": "ArcticTypescript"} ], 11 | "args": { "n" : 0 } 12 | }, 13 | { 14 | "caption": "ArcticTypescript: Go to second error", 15 | "command": "typescript_error_goto", 16 | "context": [ {"key": "ArcticTypescript"} ], 17 | "args": { "n" : 1 } 18 | }, 19 | { 20 | "caption": "ArcticTypescript: Go to third error", 21 | "command": "typescript_error_goto", 22 | "context": [ {"key": "ArcticTypescript"} ], 23 | "args": { "n" : 2 } 24 | }, 25 | { 26 | "caption": "ArcticTypescript: Go to fourth error", 27 | "command": "typescript_error_goto", 28 | "context": [ {"key": "ArcticTypescript"} ], 29 | "args": { "n" : 3 } 30 | }, 31 | { 32 | "caption": "ArcticTypescript: Go to definition", 33 | "command": "typescript_definition", 34 | "context": [ {"key": "ArcticTypescript"} ] 35 | }, 36 | { 37 | "caption": "ArcticTypescript: Reopen Project (after config changes)", 38 | "command": "typescript_reload_project", 39 | "context": [ {"key": "ArcticTypescript"} ] 40 | }, 41 | { 42 | "caption": "ArcticTypescript: View member type", 43 | "command": "typescript_type", 44 | "context": [ {"key": "ArcticTypescript"} ] 45 | }, 46 | { 47 | "caption": "ArcticTypescript: Refactoring (DO NOT USE, Test only)", 48 | "command": "typescript_references", 49 | "context": [ {"key": "ArcticTypescript"} ] 50 | }, 51 | { 52 | "caption": "ArcticTypescript: Build", 53 | "command": "typescript_build", 54 | "args": {"characters": ""}, 55 | "context": [ {"key": "ArcticTypescriptBuild"} ] 56 | }, 57 | { 58 | "caption": "ArcticTypescript: Terminate All Builds", 59 | "command": "typescript_terminate_builds" 60 | } 61 | 62 | ] 63 | -------------------------------------------------------------------------------- /lib/utils/viewutils.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | import sublime 4 | 5 | 6 | # GET VIEW CONTENT 7 | def get_content(view): 8 | return view.substr(sublime.Region(0, view.size())) 9 | 10 | 11 | def get_content_of_line_at(view, pos): 12 | return view.substr(sublime.Region(view.line(pos-1).a, pos)) 13 | 14 | 15 | def get_region(view, min_, lim): 16 | """ min_ and lim in typescipt-tool coordinates """ 17 | start_line = min_['line'] 18 | end_line = lim['line'] 19 | left = min_['character'] 20 | right = lim['character'] 21 | 22 | a = view.text_point(start_line-1, left-1) 23 | b = view.text_point(end_line-1, right-1) 24 | 25 | return sublime.Region(a,b) 26 | 27 | 28 | def get_content_of_view_at(view, min_, lim): 29 | """ min_ amd lim in typescript-tool coordinates """ 30 | return view.substr(get_region(view, min_, lim)) 31 | 32 | 33 | 34 | # GET LINES 35 | def get_lines(view): 36 | (lines, col) = view.rowcol(view.size()) 37 | return lines 38 | 39 | 40 | # GET FILE INFO 41 | def get_file_infos(view): 42 | return (view.file_name(), get_lines(view), get_content(view)) 43 | 44 | # RUN COMMAND 45 | def run_command_on_any_ts_view(command, args=None): 46 | v = get_any_ts_view() 47 | if v is not None: 48 | v.run_command(command, args) 49 | 50 | # TS VIEW 51 | def get_any_ts_view(): 52 | v = sublime.active_window().active_view() 53 | if is_ts(v) and not is_dts(v): 54 | return v 55 | for w in sublime.windows(): 56 | for v in w.views(): 57 | if is_ts(v) and not is_dts(v): 58 | return v 59 | 60 | def get_any_view_with_root(root): 61 | return 62 | from .system.Liste import get_root 63 | v = sublime.active_window().active_view() 64 | if is_ts(v) and not is_dts(v) and get_root(v.file_name()) == root: 65 | return v 66 | for w in sublime.windows(): 67 | for v in w.views(): 68 | if is_ts(v) and not is_dts(v) and get_root(v.file_name()) == root: 69 | return v 70 | 71 | 72 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/node_modules/inherits/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "inherits", 3 | "description": "A tiny simple way to do classic inheritance in js", 4 | "version": "1.0.0", 5 | "keywords": [ 6 | "inheritance", 7 | "class", 8 | "klass", 9 | "oop", 10 | "object-oriented" 11 | ], 12 | "main": "./inherits.js", 13 | "repository": { 14 | "type": "git", 15 | "url": "https://github.com/isaacs/inherits" 16 | }, 17 | "author": { 18 | "name": "Isaac Z. Schlueter", 19 | "email": "i@izs.me", 20 | "url": "http://blog.izs.me/" 21 | }, 22 | "readme": "A dead simple way to do inheritance in JS.\n\n var inherits = require(\"inherits\")\n\n function Animal () {\n this.alive = true\n }\n Animal.prototype.say = function (what) {\n console.log(what)\n }\n\n inherits(Dog, Animal)\n function Dog () {\n Dog.super.apply(this)\n }\n Dog.prototype.sniff = function () {\n this.say(\"sniff sniff\")\n }\n Dog.prototype.bark = function () {\n this.say(\"woof woof\")\n }\n\n inherits(Chihuahua, Dog)\n function Chihuahua () {\n Chihuahua.super.apply(this)\n }\n Chihuahua.prototype.bark = function () {\n this.say(\"yip yip\")\n }\n\n // also works\n function Cat () {\n Cat.super.apply(this)\n }\n Cat.prototype.hiss = function () {\n this.say(\"CHSKKSS!!\")\n }\n inherits(Cat, Animal, {\n meow: function () { this.say(\"miao miao\") }\n })\n Cat.prototype.purr = function () {\n this.say(\"purr purr\")\n }\n\n\n var c = new Chihuahua\n assert(c instanceof Chihuahua)\n assert(c instanceof Dog)\n assert(c instanceof Animal)\n\nThe actual function is laughably small. 10-lines small.\n", 23 | "readmeFilename": "README.md", 24 | "bugs": { 25 | "url": "https://github.com/isaacs/inherits/issues" 26 | }, 27 | "homepage": "https://github.com/isaacs/inherits", 28 | "_id": "inherits@1.0.0", 29 | "_from": "inherits@>=1.0.0 <2.0.0", 30 | "scripts": {} 31 | } 32 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/test/bash-comparison.js: -------------------------------------------------------------------------------- 1 | // basic test 2 | // show that it does the same thing by default as the shell. 3 | var tap = require("tap") 4 | , child_process = require("child_process") 5 | , bashResults = require("./bash-results.json") 6 | , globs = Object.keys(bashResults) 7 | , glob = require("../") 8 | , path = require("path") 9 | 10 | // run from the root of the project 11 | // this is usually where you're at anyway, but be sure. 12 | process.chdir(path.resolve(__dirname, "..")) 13 | 14 | function alphasort (a, b) { 15 | a = a.toLowerCase() 16 | b = b.toLowerCase() 17 | return a > b ? 1 : a < b ? -1 : 0 18 | } 19 | 20 | globs.forEach(function (pattern) { 21 | var expect = bashResults[pattern] 22 | // anything regarding the symlink thing will fail on windows, so just skip it 23 | if (process.platform === "win32" && 24 | expect.some(function (m) { 25 | return /\/symlink\//.test(m) 26 | })) 27 | return 28 | 29 | tap.test(pattern, function (t) { 30 | glob(pattern, function (er, matches) { 31 | if (er) 32 | throw er 33 | 34 | // sort and unmark, just to match the shell results 35 | matches = cleanResults(matches) 36 | 37 | t.deepEqual(matches, expect, pattern) 38 | t.end() 39 | }) 40 | }) 41 | 42 | tap.test(pattern + " sync", function (t) { 43 | var matches = cleanResults(glob.sync(pattern)) 44 | 45 | t.deepEqual(matches, expect, "should match shell") 46 | t.end() 47 | }) 48 | }) 49 | 50 | function cleanResults (m) { 51 | // normalize discrepancies in ordering, duplication, 52 | // and ending slashes. 53 | return m.map(function (m) { 54 | return m.replace(/\/+/g, "/").replace(/\/$/, "") 55 | }).sort(alphasort).reduce(function (set, f) { 56 | if (f !== set[set.length - 1]) set.push(f) 57 | return set 58 | }, []).sort(alphasort).map(function (f) { 59 | // de-windows 60 | return (process.platform !== 'win32') ? f 61 | : f.replace(/^[a-zA-Z]:[\/\\]+/, '/').replace(/[\\\/]+/g, '/') 62 | }) 63 | } 64 | -------------------------------------------------------------------------------- /tests/TDDTesting/main.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | var tartatos = 44; 4 | 5 | var sigma = "asdasd"; 6 | 7 | var bold = tartatos; 8 | 9 | 10 | setTimeout(function(){ 11 | document.getElementById("dyn").innerHTML = "Dynamic!" 12 | }, 1000); 13 | 14 | var k = {"abcde" : 22} 15 | 16 | 17 | type PrimitiveArray = Array; 18 | type MyNumber = number; 19 | //type NgScope = ng.IScope; 20 | type Callback = () => void; 21 | 22 | 23 | const enum Color { Blue, Green=3, Red }; 24 | var c = Color.Blue; 25 | enum Colo4r {Red = 3, Green, Blue}; 26 | enum Colo43r // wefwfe 27 | {Red //rt 28 | =1, Green, Blue}; 29 | 30 | class AClass { 31 | 32 | constructor(argument) { 33 | // code... 34 | } 35 | public foo(bar: string|number ){ /* */ 36 | } 37 | 38 | k = 22; 39 | 40 | public test() : string { 41 | var rectangle = { height: 20, width: 10 }; 42 | var substitution = 0; 43 | let total = 0; 44 | 45 | this.foo(""); 46 | 47 | var areaMessage = `Rectan$()[]{]}}"''#\/ \2123 48 | 49 | 50 | gle area is ${rectangle.height * rectangle.width}`; 51 | `literal${substitution}literal` 52 | var msg = `The total is ${total} (${total*1.05} with tax)`; 53 | 54 | `hello 55 | there`; 56 | 57 | `${total}`; 58 | 59 | `${"hey"} ${"there"} what\777 \333 are ${"you"} doing`; 60 | `hey ${`there ${4} are`} you`; 61 | 62 | function func(a, ...we) { 63 | return a 64 | } 65 | 66 | func `a${total}c${"d"}`; 67 | func`a${total}c${"d"}`; 68 | 69 | "rr\74t \333z"; 70 | 71 | func(33); 72 | 73 | let x = 5; 74 | for (let x = 1; x < 10; x++) { 75 | total += x; 76 | } 77 | console.log(x); 78 | return 'My name is ${firstname} ${lastname.toUpperCase()}' 79 | } 80 | } 81 | 82 | function f(x: number | number[]) { 83 | if (typeof x === "number") { 84 | return x + 10; 85 | } 86 | else { 87 | // return sum of numbers 88 | } 89 | } -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/test/mark.js: -------------------------------------------------------------------------------- 1 | var test = require("tap").test 2 | var glob = require('../') 3 | process.chdir(__dirname) 4 | 5 | test("mark, no / on pattern", function (t) { 6 | glob("a/*", {mark: true}, function (er, results) { 7 | if (er) 8 | throw er 9 | var expect = [ 'a/abcdef/', 10 | 'a/abcfed/', 11 | 'a/b/', 12 | 'a/bc/', 13 | 'a/c/', 14 | 'a/cb/' ] 15 | 16 | if (process.platform !== "win32") 17 | expect.push('a/symlink/') 18 | 19 | t.same(results, expect) 20 | t.end() 21 | }) 22 | }) 23 | 24 | test("mark=false, no / on pattern", function (t) { 25 | glob("a/*", function (er, results) { 26 | if (er) 27 | throw er 28 | var expect = [ 'a/abcdef', 29 | 'a/abcfed', 30 | 'a/b', 31 | 'a/bc', 32 | 'a/c', 33 | 'a/cb' ] 34 | 35 | if (process.platform !== "win32") 36 | expect.push('a/symlink') 37 | t.same(results, expect) 38 | t.end() 39 | }) 40 | }) 41 | 42 | test("mark=true, / on pattern", function (t) { 43 | glob("a/*/", {mark: true}, function (er, results) { 44 | if (er) 45 | throw er 46 | var expect = [ 'a/abcdef/', 47 | 'a/abcfed/', 48 | 'a/b/', 49 | 'a/bc/', 50 | 'a/c/', 51 | 'a/cb/' ] 52 | if (process.platform !== "win32") 53 | expect.push('a/symlink/') 54 | t.same(results, expect) 55 | t.end() 56 | }) 57 | }) 58 | 59 | test("mark=false, / on pattern", function (t) { 60 | glob("a/*/", function (er, results) { 61 | if (er) 62 | throw er 63 | var expect = [ 'a/abcdef/', 64 | 'a/abcfed/', 65 | 'a/b/', 66 | 'a/bc/', 67 | 'a/c/', 68 | 'a/cb/' ] 69 | if (process.platform !== "win32") 70 | expect.push('a/symlink/') 71 | t.same(results, expect) 72 | t.end() 73 | }) 74 | }) 75 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/node_modules/minimatch/node_modules/sigmund/README.md: -------------------------------------------------------------------------------- 1 | # sigmund 2 | 3 | Quick and dirty signatures for Objects. 4 | 5 | This is like a much faster `deepEquals` comparison, which returns a 6 | string key suitable for caches and the like. 7 | 8 | ## Usage 9 | 10 | ```javascript 11 | function doSomething (someObj) { 12 | var key = sigmund(someObj, maxDepth) // max depth defaults to 10 13 | var cached = cache.get(key) 14 | if (cached) return cached) 15 | 16 | var result = expensiveCalculation(someObj) 17 | cache.set(key, result) 18 | return result 19 | } 20 | ``` 21 | 22 | The resulting key will be as unique and reproducible as calling 23 | `JSON.stringify` or `util.inspect` on the object, but is much faster. 24 | In order to achieve this speed, some differences are glossed over. 25 | For example, the object `{0:'foo'}` will be treated identically to the 26 | array `['foo']`. 27 | 28 | Also, just as there is no way to summon the soul from the scribblings 29 | of a cocain-addled psychoanalyst, there is no way to revive the object 30 | from the signature string that sigmund gives you. In fact, it's 31 | barely even readable. 32 | 33 | As with `sys.inspect` and `JSON.stringify`, larger objects will 34 | produce larger signature strings. 35 | 36 | Because sigmund is a bit less strict than the more thorough 37 | alternatives, the strings will be shorter, and also there is a 38 | slightly higher chance for collisions. For example, these objects 39 | have the same signature: 40 | 41 | var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]} 42 | var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']} 43 | 44 | Like a good Freudian, sigmund is most effective when you already have 45 | some understanding of what you're looking for. It can help you help 46 | yourself, but you must be willing to do some work as well. 47 | 48 | Cycles are handled, and cyclical objects are silently omitted (though 49 | the key is included in the signature output.) 50 | 51 | The second argument is the maximum depth, which defaults to 10, 52 | because that is the maximum object traversal depth covered by most 53 | insurance carriers. 54 | -------------------------------------------------------------------------------- /bin/expandglob.js: -------------------------------------------------------------------------------- 1 | 2 | var expand = require('glob-expand'); 3 | var fs = require('fs'); 4 | 5 | 6 | // This file reads the tsconfig.json in the current working directory (cwd) 7 | // and parses the "filesGlob" in the same way (with the same library) as 8 | // atom-typescript does it. Writes the file to disk 9 | 10 | // https://github.com/TypeStrong/atom-typescript/blob/master/lib/main/tsconfig/tsconfig.ts 11 | // https://github.com/anodynos/node-glob-expand/blob/master/source/code/expand.coffee 12 | 13 | // reads tsconfig in working dir 14 | // expects filesGlob to exist 15 | 16 | // returns {"error": "errormessage"} on failure 17 | // returns {"error": false, files": []} on success 18 | 19 | 20 | 21 | var projectFileName = 'tsconfig.json'; 22 | var dir = '.'; 23 | var projectFile = ''; 24 | 25 | try { 26 | if (!fs.existsSync(projectFileName)) { 27 | throw new Error("tsconfig.json does not exist in cwd"); 28 | } 29 | try { 30 | var projectFileTextContent = fs.readFileSync(projectFileName, 'utf8'); 31 | } 32 | catch (ex) { 33 | throw new Error("failed to read tsconfig.json"); 34 | } 35 | try { 36 | projectSpec = JSON.parse(projectFileTextContent); 37 | } 38 | catch (ex) { 39 | throw new Error("json parsing of tsonfig.json failed"); 40 | } 41 | if (!projectSpec.filesGlob) { 42 | throw new Error("tsonfig.json does not have field 'filesGlob'"); 43 | } 44 | 45 | files = expand({ filter: 'isFile', cwd: dir }, projectSpec.filesGlob); 46 | projectSpec.files = files; 47 | 48 | var prettyJSONProjectSpec = prettyJSON(projectSpec); 49 | 50 | if (prettyJSONProjectSpec !== projectFileTextContent) { 51 | fs.writeFileSync(projectFileName, prettyJSONProjectSpec); 52 | } 53 | 54 | console.log(JSON.stringify({"error": false, "files": files})); 55 | } 56 | catch (ex) { 57 | console.log(JSON.stringify({"error": ex.message})); 58 | } 59 | 60 | 61 | 62 | function prettyJSON(object) { 63 | var cache = []; 64 | var value = JSON.stringify(object, function (key, value) { 65 | if (typeof value === 'object' && value !== null) { 66 | if (cache.indexOf(value) !== -1) { 67 | return; 68 | } 69 | cache.push(value); 70 | } 71 | return value; 72 | }, 4); 73 | cache = null; 74 | return value; 75 | } -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/test/pause-resume.js: -------------------------------------------------------------------------------- 1 | // show that no match events happen while paused. 2 | var tap = require("tap") 3 | , child_process = require("child_process") 4 | // just some gnarly pattern with lots of matches 5 | , pattern = "test/a/!(symlink)/**" 6 | , bashResults = require("./bash-results.json") 7 | , patterns = Object.keys(bashResults) 8 | , glob = require("../") 9 | , Glob = glob.Glob 10 | , path = require("path") 11 | 12 | // run from the root of the project 13 | // this is usually where you're at anyway, but be sure. 14 | process.chdir(path.resolve(__dirname, "..")) 15 | 16 | function alphasort (a, b) { 17 | a = a.toLowerCase() 18 | b = b.toLowerCase() 19 | return a > b ? 1 : a < b ? -1 : 0 20 | } 21 | 22 | function cleanResults (m) { 23 | // normalize discrepancies in ordering, duplication, 24 | // and ending slashes. 25 | return m.map(function (m) { 26 | return m.replace(/\/+/g, "/").replace(/\/$/, "") 27 | }).sort(alphasort).reduce(function (set, f) { 28 | if (f !== set[set.length - 1]) set.push(f) 29 | return set 30 | }, []).sort(alphasort).map(function (f) { 31 | // de-windows 32 | return (process.platform !== 'win32') ? f 33 | : f.replace(/^[a-zA-Z]:\\\\/, '/').replace(/\\/g, '/') 34 | }) 35 | } 36 | 37 | var globResults = [] 38 | tap.test("use a Glob object, and pause/resume it", function (t) { 39 | var g = new Glob(pattern) 40 | , paused = false 41 | , res = [] 42 | , expect = bashResults[pattern] 43 | 44 | g.on("pause", function () { 45 | console.error("pause") 46 | }) 47 | 48 | g.on("resume", function () { 49 | console.error("resume") 50 | }) 51 | 52 | g.on("match", function (m) { 53 | t.notOk(g.paused, "must not be paused") 54 | globResults.push(m) 55 | g.pause() 56 | t.ok(g.paused, "must be paused") 57 | setTimeout(g.resume.bind(g), 10) 58 | }) 59 | 60 | g.on("end", function (matches) { 61 | t.pass("reached glob end") 62 | globResults = cleanResults(globResults) 63 | matches = cleanResults(matches) 64 | t.deepEqual(matches, globResults, 65 | "end event matches should be the same as match events") 66 | 67 | t.deepEqual(matches, expect, 68 | "glob matches should be the same as bash results") 69 | 70 | t.end() 71 | }) 72 | }) 73 | 74 | -------------------------------------------------------------------------------- /lib/commands/Refactor.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | from threading import Thread 4 | 5 | import sublime 6 | import os 7 | 8 | 9 | from ..utils import Debug 10 | from ..utils.fileutils import read_file, file_exists, fn2k 11 | 12 | 13 | # ----------------------------------------- UTILS --------------------------------------- # 14 | 15 | def show_output(window, line): 16 | PANEL.show(window) 17 | PANEL.update(line['output']) 18 | 19 | def clear_panel(window): 20 | PANEL.clear(window) 21 | 22 | 23 | # ########################################################################## 24 | # ########################################## REFACTOR ###################### 25 | # ########################################################################## 26 | 27 | 28 | #{'lineText': ' let total = 0;', 29 | # 'file': '/home/daniel/.config/sublime-text-3/Packages/ArcticTypescript/tests/TDDTesting/main.ts', 30 | # 'min': {'character': 13, 31 | # 'line': 43}, 32 | # 'lim': {'character': 18, 33 | # 'line': 43}, 34 | # 'ref': {'textSpan': {'start': 760, 35 | # 'length': 5}, 36 | # 'fileName': '/home/daniel/.config/sublime-text-3/Packages/ArcticTypescript/tests/TDDTesting/main.ts', 37 | # 'isWriteAccess': True}} 38 | 39 | 40 | class Refactor(): 41 | 42 | def __init__(self, edit, project, refs, old_name, new_name): 43 | Thread.__init__(self) 44 | self.project = project 45 | self.refs = {r['ref'] for r in refs} 46 | self.old_name = old_name 47 | self.new_name = new_name 48 | self.edit_token = edit_token 49 | 50 | 51 | def start(self): 52 | self.run() 53 | 54 | def run(self): 55 | self.sort_by_file() 56 | Debug('refactor', self.refs_by_file) 57 | 58 | for (file_, refs_in) in self.refs_by_file.values(): 59 | self.refactor_file(file_, refs_in) 60 | 61 | 62 | def sort_by_file(self): 63 | """ sort references by file """ 64 | 65 | self.refs_by_file = {} # key is the fn2k'ed filename 66 | 67 | for ref in self.refs: 68 | file_ = fn2k(ref['file']) 69 | if file_ not in self.refs_by_file: 70 | self.refs_by_file[file_] = [] 71 | 72 | self.refs_by_file[file_].append(ref) 73 | 74 | 75 | def refactor_file(self, file_name_keyed, refs_in): 76 | 77 | 78 | 79 | Debug('refactor', 'got here! :D') 80 | return 81 | 82 | 83 | -------------------------------------------------------------------------------- /lib/utils/utils.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | import sublime 4 | import time 5 | import hashlib 6 | 7 | 8 | # ##################################################### VERSION ############ 9 | 10 | 11 | version = int(sublime.version()) 12 | 13 | 14 | # ##################################################### BYTE/STRING utils ## 15 | 16 | 17 | def encode(message): 18 | return bytes(message,'UTF-8') 19 | 20 | 21 | def make_hash(value): 22 | """ Returns md5 hash of . """ 23 | return hashlib.md5(encode(value)).hexdigest() 24 | 25 | 26 | def random_str(): 27 | """ Returns a random string, made out of the current time """ 28 | return make_hash(str(time.time())) 29 | 30 | 31 | def replace_variables(value, variables): 32 | if hasattr(sublime, 'expand_variables'): # ST3, Build 3068 33 | # stringify dict 34 | for k in variables.keys(): 35 | variables[k] = str(variables[k]); 36 | return sublime.expand_variables(value, variables) 37 | else: 38 | # sort keys after length, to get $file_path before $file 39 | keys = list(variables.keys()) 40 | keys.sort(key=len, reverse=True) 41 | for k in keys: 42 | key = "${%s}" % k 43 | if key in value: 44 | value = value.replace(key, str(variables[k])) 45 | return value 46 | 47 | 48 | # ##################################################### LIST utils ######### 49 | 50 | 51 | def get_first(somelist, function): 52 | """ Returns the first item of somelist for which function(item) is True """ 53 | for item in somelist: 54 | if function(item): 55 | return item 56 | return None 57 | 58 | 59 | # ################################################### OBJECT utils ######### 60 | 61 | 62 | def get_deep(obj, selector): 63 | """ Returns the object given by the selector, eg a:b:c:1 for ['a']['b']['c'][1] """ 64 | try: 65 | if type(selector) is str: 66 | selector = selector.split(':') 67 | 68 | if len(selector) == 0: 69 | return obj 70 | 71 | top_selector = selector.pop(0) 72 | 73 | if type(obj) is list: 74 | top_selector = int(top_selector) 75 | return get_deep(obj[top_selector], selector) 76 | 77 | if type(obj) is dict: 78 | return get_deep(obj[top_selector], selector) 79 | 80 | if obj is None: 81 | raise KeyError() 82 | except: 83 | raise KeyError(str(selector)) 84 | 85 | 86 | -------------------------------------------------------------------------------- /lib/server/typescripttoolsparser.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | import re 4 | from ..utils.fileutils import fn2k 5 | 6 | def normalize_tssjs_error_output(self, errors): 7 | """ 8 | Takes the de-jsoned output of the tss.js error command and creates 9 | some dicts for easy access 10 | """ 11 | 12 | 13 | def tssjs_to_errorview(self, errors): 14 | """ 15 | Takes the de-jsoned output of the tss.js error command and creates the content for the error view. 16 | It also creates a relation between each line in the error view and the file and position of the error. 17 | 18 | Returns text, \ 19 | line_to_file[line] = filename,\ 20 | line_to_pos[line] = ((l,c),(l,c)) 21 | 22 | """ 23 | line_to_file = {} 24 | line_to_pos = {} 25 | 26 | previous_file = '' 27 | line = 0 28 | 29 | for e in errors: 30 | filename = e['file'].split('/')[-1] 31 | if previous_file != filename: 32 | text.append("\n\nOn File : %s \n" % filename) 33 | line += 3 34 | previous_file = filename 35 | 36 | text.append("\n%i >" % e['start']['line']) 37 | text.append(re.sub(r'^.*?:\s*', '', e['text'].replace('\r',''))) 38 | line += 1 39 | 40 | a = (e['start']['line']-1, e['start']['character']-1) 41 | b = (e['end']['line']-1, e['end']['character']-1) 42 | line_to_pos[line] = (a,b) 43 | line_to_file[line] = e['file'] 44 | 45 | 46 | if len(errors) == 0: 47 | text.append("\n\nno errors") 48 | 49 | text.append('\n') 50 | text = ''.join(text) 51 | 52 | return text, line_to_file, line_to_pos 53 | 54 | 55 | def tssjs_to_highlighter(self, errors, file_name): 56 | """ 57 | Creates a list of error and warning regions for all errors. 58 | 59 | Returns error_regions, warning_regions 60 | """ 61 | error_regions = [] 62 | warning_regions = [] 63 | 64 | key = fn2k(file_name) 65 | self.errors[key] = {} 66 | 67 | for e in errors: 68 | if fn2k(e['file']) == key: 69 | 70 | a = view.text_point(e['start']['line']-1, e['start']['character']-1) 71 | b = view.text_point(e['end']['line']-1, e['end']['character']-1) 72 | 73 | self.errors[key][(a,b)] = e['text'] 74 | 75 | if e['category'] == 'Error': 76 | error_regions.append(sublime.Region(a,b)) 77 | else: 78 | warning_regions.append(sublime.Region(a,b)) 79 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/node_modules/graceful-fs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": { 3 | "name": "Isaac Z. Schlueter", 4 | "email": "i@izs.me", 5 | "url": "http://blog.izs.me" 6 | }, 7 | "name": "graceful-fs", 8 | "description": "A drop-in replacement for fs, making various improvements.", 9 | "version": "1.2.3", 10 | "repository": { 11 | "type": "git", 12 | "url": "git://github.com/isaacs/node-graceful-fs.git" 13 | }, 14 | "main": "graceful-fs.js", 15 | "engines": { 16 | "node": ">=0.4.0" 17 | }, 18 | "directories": { 19 | "test": "test" 20 | }, 21 | "scripts": { 22 | "test": "tap test/*.js" 23 | }, 24 | "keywords": [ 25 | "fs", 26 | "module", 27 | "reading", 28 | "retry", 29 | "retries", 30 | "queue", 31 | "error", 32 | "errors", 33 | "handling", 34 | "EMFILE", 35 | "EAGAIN", 36 | "EINVAL", 37 | "EPERM", 38 | "EACCESS" 39 | ], 40 | "license": "BSD", 41 | "readme": "# graceful-fs\n\ngraceful-fs functions as a drop-in replacement for the fs module,\nmaking various improvements.\n\nThe improvements are meant to normalize behavior across different\nplatforms and environments, and to make filesystem access more\nresilient to errors.\n\n## Improvements over fs module\n\ngraceful-fs:\n\n* keeps track of how many file descriptors are open, and by default\n limits this to 1024. Any further requests to open a file are put in a\n queue until new slots become available. If 1024 turns out to be too\n much, it decreases the limit further.\n* fixes `lchmod` for Node versions prior to 0.6.2.\n* implements `fs.lutimes` if possible. Otherwise it becomes a noop.\n* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or\n `lchown` if the user isn't root.\n* makes `lchmod` and `lchown` become noops, if not available.\n* retries reading a file if `read` results in EAGAIN error.\n\nOn Windows, it retries renaming a file for up to one second if `EACCESS`\nor `EPERM` error occurs, likely because antivirus software has locked\nthe directory.\n\n## Configuration\n\nThe maximum number of open file descriptors that graceful-fs manages may\nbe adjusted by setting `fs.MAX_OPEN` to a different number. The default\nis 1024.\n", 42 | "readmeFilename": "README.md", 43 | "bugs": { 44 | "url": "https://github.com/isaacs/node-graceful-fs/issues" 45 | }, 46 | "homepage": "https://github.com/isaacs/node-graceful-fs", 47 | "_id": "graceful-fs@1.2.3", 48 | "_from": "graceful-fs@>=1.2.0 <1.3.0" 49 | } 50 | -------------------------------------------------------------------------------- /examples/basic_browser_project/built/mycode.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"mycode.js","sourceRoot":"","sources":["../src/insanity.ts","../src/main.ts","../src/main2.ts"],"names":["Insanity","Insanity.CountdownToInsanity","Insanity.CountdownToInsanity.constructor","Insanity.CountdownToInsanity.start","Insanity.CountdownToInsanity.tick","Insanity.CountdownToInsanity.start_insanity","Insanity.CountdownToInsanity.stop"],"mappings":"AAAA,IAAO,QAAQ,CAmDd;AAnDD,WAAO,QAAQ,EAAC,CAAC;IAIhBA,AAHDA,+DAA+DA;IAC/DA,kEAAkEA;QAE7DA,UAAUA,GAAWA,EAAEA,CAACA;IAE5BA,IAAaA,mBAAmBA;QAQ5BC,SARSA,mBAAmBA,CAQRA,OAAoBA;YAApBC,YAAOA,GAAPA,OAAOA,CAAaA;YAN3CA,gBAAWA,GAAWA,IAAIA,CAACA;YAC3BA,0BAAqBA,GAAWA,IAAIA,CAACA;YACrCA,qBAAgBA,GAAGA,CAACA,CAACA;YACrBA,cAASA,GAAaA,CAACA,OAAOA,EAAEA,KAAKA,EAAEA,OAAOA,EAAEA,QAAQA,CAACA,CAAAA;QAItDA,CAACA;QAEMD,mCAAKA,GAAZA;YAAAE,iBAGCA;YAFAA,IAAIA,CAACA,UAAUA,GAAGA,UAAUA,CAACA;YAC1BA,IAAIA,CAACA,WAAWA,GAAGA,WAAWA,CAACA,cAAQA,KAAIA,CAACA,IAAIA,EAAEA,CAAAA,CAACA,CAACA,EAAEA,IAAIA,CAACA,CAAAA;QAC/DA,CAACA;QAGOF,kCAAIA,GAAZA;YACCG,IAAIA,CAACA,UAAUA,IAAIA,CAACA,CAACA;YACrBA,IAAIA,CAACA,OAAOA,CAACA,SAASA,GAAGA,IAAIA,CAACA,UAAUA,CAACA,QAAQA,EAAEA,CAACA;YACpDA,EAAEA,CAACA,CAACA,IAAIA,CAACA,UAAUA,IAAIA,CAACA,CAACA,CAACA,CAACA;gBAC1BA,IAAIA,CAACA,IAAIA,EAAEA,CAACA;gBACZA,IAAIA,CAACA,cAAcA,EAAEA,CAACA;YACvBA,CAACA;QACFA,CAACA;QAEOH,4CAAcA,GAAtBA;YAAAI,iBAKCA;YAJAA,IAAIA,CAACA,qBAAqBA,GAAGA,WAAWA,CAACA;gBACvCA,KAAIA,CAACA,gBAAgBA,GAAGA,CAACA,KAAIA,CAACA,gBAAgBA,GAAGA,CAACA,CAACA,GAAGA,KAAIA,CAACA,SAASA,CAACA,MAAMA,CAACA;gBAC5EA,QAAQA,CAACA,IAAIA,CAACA,KAAKA,CAACA,kBAAkBA,CAACA,GAAGA,KAAIA,CAACA,SAASA,CAACA,KAAIA,CAACA,gBAAgBA,CAACA,CAACA;YACjFA,CAACA,EAAEA,GAAGA,CAACA,CAACA;QACVA,CAACA;QAEMJ,kCAAIA,GAAXA;YACCK,EAAEA,CAACA,CAACA,IAAIA,CAACA,WAAWA,CAACA,CAACA,CAACA;gBACnBA,aAAaA,CAACA,IAAIA,CAACA,WAAWA,CAACA,CAACA;gBACnCA,IAAIA,CAACA,WAAWA,GAAGA,IAAIA,CAACA;YACzBA,CAACA;YACDA,EAAEA,CAACA,CAACA,IAAIA,CAACA,qBAAqBA,CAACA,CAACA,CAACA;gBAC7BA,aAAaA,CAACA,IAAIA,CAACA,qBAAqBA,CAACA,CAACA;gBAC7CA,IAAIA,CAACA,qBAAqBA,GAAGA,IAAIA,CAACA;YACnCA,CAACA;QACFA,CAACA;QAELL,0BAACA;IAADA,CAACA,AA5CDD,IA4CCA;IA5CYA,4BAAmBA,GAAnBA,mBA4CZA,CAAAA;AACFA,CAACA,EAnDM,QAAQ,KAAR,QAAQ,QAmDd;ACnDD,oCAAoC;AAGpC,IAAI,iBAAiB,GAAgB,QAAQ,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;AAClF,IAAI,gBAAgB,GAAG,IAAI,QAAQ,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;AAE3E,gBAAgB,CAAC,KAAK,EAAE,CAAA;AAExB,IAAI,YAAY,GAAgB,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;AAChE,YAAY,CAAC,OAAO,GAAG,cAAa,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;ACR9D,8BAA8B;AAC9B,0FAA0F;AAC1F,6EAA6E;AAK7E,AAHA,0FAA0F;AAC1F,mFAAmF;AAE7E,MAAO,CAAC,0BAA0B,GAAG,IAAI,CAAC"} -------------------------------------------------------------------------------- /ArcticTypescript.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | import sublime 4 | 5 | if int(sublime.version()) >= 3000: 6 | 7 | # DISABLE until API is ready 8 | from .lib.utils.disabling import set_plugin_temporarily_enabled, \ 9 | set_plugin_temporarily_disabled 10 | set_plugin_temporarily_disabled() 11 | 12 | # PREPARE for mac 13 | from .lib.utils.pathutils import add_usr_local_bin_to_path_on_osx 14 | add_usr_local_bin_to_path_on_osx() 15 | 16 | # IMPORT COMMANDS and LISTENERS 17 | from .lib.Commands import * 18 | from .lib.Listener import TypescriptEventListener 19 | from .lib.tsconfiglint.TsconfigListener import TsconfigEventListener 20 | from .lib.display.T3SViews import TypescriptEventListener2 21 | from .lib.system.Project import get_or_create_project_and_add_view, \ 22 | close_all_projects 23 | 24 | 25 | def plugin_loaded(): 26 | """ This will be called by sublime if the API is ready """ 27 | # ENABLE since API is ready 28 | set_plugin_temporarily_enabled() 29 | 30 | # Activate Typescript if current view is a .ts file 31 | view = sublime.active_window().active_view() 32 | sublime.set_timeout(lambda: get_or_create_project_and_add_view(view), 300) 33 | 34 | # Testing (Only executes if we have opened the TDDTesting project) 35 | # Use filepattern to select tests. Examples: '*foo*', 'test_foo.py' 36 | run_tests(filepattern='*utils*') # 37 | 38 | 39 | def plugin_unloaded(): 40 | """ This will be called by sublime if this plugin will be unloaded """ 41 | set_plugin_temporarily_disabled() 42 | close_all_projects() 43 | # TODO: Kill processes 44 | 45 | 46 | def run_tests(filepattern=''): 47 | """ Run tests if this project is named TDDTesting """ 48 | testproject = "ArcticTypescript/tests/TDDTesting/TDDTesting.sublime-project" 49 | projectfile = sublime.active_window().project_file_name() 50 | package_pattern = 'ArcticTypescript' 51 | if filepattern != '': 52 | package_pattern = "%s:%s" % (package_pattern, filepattern) 53 | if projectfile is not None and projectfile.endswith(testproject): 54 | sublime.set_timeout(lambda:sublime.run_command( 55 | 'unit_testing', 56 | {'output': 'panel', 'package': package_pattern}), 300) 57 | 58 | else: 59 | sublime.error_message("ArcticTypescript does not support Sublime Text 2") 60 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/build/code/expand.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * glob-expand - version 0.0.2 3 | * Compiled on 2013-05-27 4 | * git://github.com/anodynos/node-glob-expand 5 | * Copyright(c) 2013 Agelos Pikoulas (agelos.pikoulas@gmail.com ) 6 | * Licensed MIT http://www.opensource.org/licenses/mit-license.php 7 | */ 8 | var VERSION = '0.0.2'; //injected by grunt:concat 9 | // Generated by CoffeeScript 1.6.2 10 | var expand, fs, glob, path, processPatterns, _, 11 | __slice = [].slice; 12 | 13 | _ = require('lodash'); 14 | 15 | glob = require('glob'); 16 | 17 | fs = require('fs'); 18 | 19 | path = require('path'); 20 | 21 | expand = function() { 22 | var args, matches, options, patterns; 23 | 24 | args = 1 <= arguments.length ? __slice.call(arguments, 0) : []; 25 | options = _.isObject(args[0]) ? args.shift() : {}; 26 | patterns = (_.isArray(args[0]) ? args[0] : args); 27 | if (patterns.length === 0) { 28 | return []; 29 | } 30 | matches = processPatterns(patterns, function(pattern) { 31 | if (_.isString(pattern)) { 32 | return glob.sync(pattern, options); 33 | } else { 34 | if (_.isRegExp(pattern)) { 35 | return _.filter(glob.sync('**/*.*', options), function(filename) { 36 | return filename.match(pattern); 37 | }); 38 | } else { 39 | return []; 40 | } 41 | } 42 | }); 43 | if (options.filter) { 44 | matches = matches.filter(function(filepath) { 45 | var e; 46 | 47 | filepath = path.join(options.cwd || "", filepath); 48 | try { 49 | if (_.isFunction(options.filter)) { 50 | return options.filter(filepath); 51 | } else { 52 | return fs.statSync(filepath)[options.filter](); 53 | } 54 | } catch (_error) { 55 | e = _error; 56 | return false; 57 | } 58 | }); 59 | } 60 | return matches; 61 | }; 62 | 63 | processPatterns = function(patterns, fn) { 64 | var result; 65 | 66 | result = []; 67 | _.flatten(patterns).forEach(function(pattern) { 68 | var exclusion, matches; 69 | 70 | exclusion = _.isString(pattern) && pattern.indexOf("!") === 0; 71 | if (exclusion) { 72 | pattern = pattern.slice(1); 73 | } 74 | matches = fn(pattern); 75 | if (exclusion) { 76 | return result = _.difference(result, matches); 77 | } else { 78 | return result = _.union(result, matches); 79 | } 80 | }); 81 | return result; 82 | }; 83 | 84 | module.exports = expand; 85 | 86 | _.extend(expand, { 87 | glob: glob, 88 | VERSION: typeof VERSION !== "undefined" && VERSION !== null ? VERSION : '{NO_VERSION}' 89 | }); 90 | -------------------------------------------------------------------------------- /lib/utils/options.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | # the values are validators! 4 | 5 | 6 | 7 | compileroptions_validations = { 8 | "target" : ["es3", "es5", "es6"], #?: string; // 'es3'|'es5' (default) | 'es6' 9 | "module" : ["amd", "commonjs"], #?: string; // 'amd'|'commonjs' (default) 10 | "declaration" : bool, #?: boolean; // Generates corresponding `.d.ts` file 11 | "out" : "(.*[^/]\.js)$", #?: string; // Concatenate and emit a single file 12 | "outDir" : "(.+/)$", #?: string; // Redirect output structure to this directory 13 | "noImplicitAny" : bool, #?: boolean; // Error on inferred `any` type 14 | "suppressImplicitAnyIndexErrors" : bool, 15 | "removeComments" : bool, #?: boolean; // Do not emit comments in output 16 | "sourceMap" : bool, #?: boolean; // Generates SourceMaps (.map files) 17 | "sourceRoot" : str, #?: string; // Optionally specifies the location where debugger should locate TypeScript source files after deployment 18 | "mapRoot" : str, #?: string; // Optionally Specifies the location where debugger should locate map files after deployment 19 | "preserveConstEnums" : bool, #?:boolean; // Do not erase const enum declarations in generated code. 20 | "removeComments" : bool, #?: boolean; // Do not emit comments to output. 21 | # these options are from the atom typescript tsconfig.ts 22 | "allowNonTsExtensions" : bool, 23 | "charset" : str, 24 | "codepage" : int, 25 | "declaration" : bool, 26 | "diagnostics" : bool, 27 | "emitBOM" : bool, 28 | "locals" : str, 29 | "noEmitOnError" : bool, 30 | "noErrorTruncation" : bool, 31 | "noLib" : bool, 32 | "noLibCheck" : bool, 33 | "noResolve" : bool, 34 | "version" : bool, 35 | "watch" : bool, 36 | } 37 | allowed_compileroptions = list(compileroptions_validations.keys()) 38 | 39 | 40 | settings_validations = { 41 | "activate_build_system": bool, #?:boolean; default: true 42 | "enable_refactoring": bool, #?:boolean, default: false 43 | "auto_complete": bool, #?:boolean, default: true 44 | "node_path": str, #?:string, default: null -> nodejs in $PATH 45 | "tsc_path": str, #?:string, default: null -> search a node_modules dir with tsc or use ArcticTypescript's tsc 46 | "error_on_save_only": bool, #?:boolean, default: false 47 | "build_on_save": bool, #?:boolean, default: false 48 | "show_build_file": bool, #?:boolean, default: false 49 | "pre_processing_commands": list, #?:[string] default: [] 50 | "post_processing_commands": list, #?:[string] default: [] 51 | } 52 | allowed_settings = list(settings_validations.keys()) -------------------------------------------------------------------------------- /lib/utils/fileutils.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | import os 4 | import codecs 5 | import hashlib 6 | import json 7 | 8 | 9 | 10 | # IS A TYPESCRIPT DEFINITION FILE 11 | def is_dts(view): 12 | return view.file_name() and view.file_name().endswith('.d.ts') 13 | 14 | 15 | # IS A TYPESCRIPT FILE 16 | def is_ts(view): 17 | if view is None: 18 | return False 19 | fn = view.file_name() 20 | fn2 = view.file_name() 21 | fn3 = view.file_name() 22 | if fn is None or fn2 is None: 23 | return False 24 | if fn is None or fn2 is None or fn3 is None: 25 | pass 26 | #import spdb ; spdb.start() 27 | return fn.endswith('.ts') and not fn.endswith('.d.ts') 28 | 29 | 30 | # READ FILE 31 | def read_file(filename): 32 | """ returns None or file contents if available """ 33 | filename = os.path.normcase(filename) # back to \\ in nt 34 | if os.path.isfile(filename): 35 | try: 36 | if os.name == 'nt': 37 | return open(filename, 'r', encoding='utf8').read() 38 | else: 39 | return codecs.open(filename, 'r', 'utf-8').read() 40 | except IOError: 41 | pass 42 | return None 43 | 44 | 45 | # MAKE MD5 of disk contents of file 46 | def hash_file(filename, blocksize=65536): 47 | f = open(filename) 48 | buf = f.read(blocksize) 49 | hasher = hashlib.md5() 50 | while len(buf) > 0: 51 | hasher.update(encode(buf)) 52 | buf = f.read(blocksize) 53 | f.close() 54 | return hasher.hexdigest() 55 | 56 | 57 | def read_and_decode_json_file(filename): 58 | """ returns None or json-decoded file contents as object,list,... """ 59 | f = read_file(filename) 60 | return json.loads(f) if f is not None else None 61 | 62 | # FILE EXISTS 63 | def file_exists(filename): 64 | """ returns weather the file exists """ 65 | return os.path.isfile(os.path.normcase(filename)) 66 | 67 | 68 | 69 | # FILENAME transformations 70 | def filename2linux(filename): 71 | """ returns filename with linux slashes. Also makes normcase before! 72 | (Windows: normcase: /->\\ and lowercase), then back to / """ 73 | return os.path.normcase(filename).replace('\\','/') 74 | 75 | 76 | def filename2key(filename): 77 | """ returns the unified version of filename which can be used as dict key """ 78 | return filename2linux(realfn(filename)).lower() 79 | 80 | 81 | def fn2k(filename): 82 | """ shortcut for filename2key """ 83 | return filename2key(filename) 84 | 85 | 86 | def fn2l(filename): 87 | """ shortcut for filename2linux """ 88 | return filename2linux(filename) 89 | 90 | 91 | def realfn(filename): 92 | """ Returns the filename while resolving relative paths. (Tsserver is using 93 | those resolved paths now.) """ 94 | return os.path.realpath(filename) 95 | -------------------------------------------------------------------------------- /lib/utils/disabling.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | import sublime 4 | import os 5 | 6 | from .debug import Debug 7 | 8 | from ..system.globals import plugin_disabled_for_folders 9 | 10 | # ############## Allows Disabling of ArcticTypescript ###################### 11 | 12 | 13 | # has a global variable in globals.py 14 | 15 | 16 | def is_plugin_globally_disabled(): 17 | return "*global" in plugin_disabled_for_folders 18 | 19 | def is_plugin_temporarily_disabled(folder=None): 20 | """ Returns True if the plugin is disabled globally or for folder. 21 | Folder can be a view """ 22 | if is_plugin_globally_disabled() or folder is None: 23 | return is_plugin_globally_disabled() 24 | if folder is not None and isinstance(folder, sublime.View): 25 | if folder.file_name() is None: 26 | return is_plugin_globally_disabled() 27 | folder = os.path.dirname(folder.file_name()) 28 | folder = os.path.normcase(folder) 29 | return folder in plugin_disabled_for_folders 30 | 31 | 32 | def set_plugin_temporarily_enabled(folder=None): 33 | """ Disables the plugin globally or for folder. 34 | Folder can be a view """ 35 | if folder is None: 36 | if is_plugin_globally_disabled(): 37 | plugin_disabled_for_folders.remove("*global") 38 | else: 39 | if isinstance(folder, sublime.View): 40 | folder = os.path.dirname(folder.file_name()) 41 | folder = os.path.normcase(folder) 42 | Debug('project', 'Enable ArcticTypescript for %s' % folder) 43 | if folder in plugin_disabled_for_folders: 44 | plugin_disabled_for_folders.remove(folder) 45 | 46 | 47 | def set_plugin_temporarily_disabled(folder=None): 48 | """ Enables the plugin globally or for folder. 49 | Folder can be a view """ 50 | if folder is None: 51 | if not is_plugin_globally_disabled(): 52 | plugin_disabled_for_folders.append("*global") 53 | else: 54 | if isinstance(folder, sublime.View): 55 | folder = os.path.dirname(folder.file_name()) 56 | folder = os.path.normcase(folder) 57 | Debug('project', 'Disable ArcticTypescript for %s' % folder) 58 | if folder not in plugin_disabled_for_folders: 59 | plugin_disabled_for_folders.append(folder) 60 | 61 | 62 | def set_tsglobexpansion_disabled(): 63 | """ Sets the disabled flag for tsglobexpansion """ 64 | if "*tsglob" not in plugin_disabled_for_folders: 65 | plugin_disabled_for_folders.append("*tsglob") 66 | 67 | 68 | def set_tsglobexpansion_enabled(): 69 | """ Clears the disabled flag for tsglobexpansion """ 70 | if "*tsglob" in plugin_disabled_for_folders: 71 | plugin_disabled_for_folders.remove("*tsglob") 72 | 73 | 74 | def is_tsglobexpansion_disabled(): 75 | """ Checks the disabled flag for tsglobexpansion """ 76 | return "*tsglob" in plugin_disabled_for_folders 77 | 78 | -------------------------------------------------------------------------------- /examples/basic_browser_project/built/mycode.js: -------------------------------------------------------------------------------- 1 | var Insanity; 2 | (function (Insanity) { 3 | // it is allowed to split a single module across multiple files 4 | // so it would be fine to have other files with module Insanity {} 5 | var start_time = 21; 6 | var CountdownToInsanity = (function () { 7 | function CountdownToInsanity(element) { 8 | this.element = element; 9 | this.interval_id = null; 10 | this.insanity_intervall_id = null; 11 | this.bg_color_counter = 1; 12 | this.bg_colors = ['white', 'red', 'black', 'orange']; 13 | } 14 | CountdownToInsanity.prototype.start = function () { 15 | var _this = this; 16 | this.time_to_go = start_time; 17 | this.interval_id = setInterval(function () { _this.tick(); }, 1000); 18 | }; 19 | CountdownToInsanity.prototype.tick = function () { 20 | this.time_to_go -= 1; 21 | this.element.innerHTML = this.time_to_go.toString(); 22 | if (this.time_to_go == 0) { 23 | this.stop(); 24 | this.start_insanity(); 25 | } 26 | }; 27 | CountdownToInsanity.prototype.start_insanity = function () { 28 | var _this = this; 29 | this.insanity_intervall_id = setInterval(function () { 30 | _this.bg_color_counter = (_this.bg_color_counter + 1) % _this.bg_colors.length; 31 | document.body.style['background-color'] = _this.bg_colors[_this.bg_color_counter]; 32 | }, 100); 33 | }; 34 | CountdownToInsanity.prototype.stop = function () { 35 | if (this.interval_id) { 36 | clearInterval(this.interval_id); 37 | this.interval_id = null; 38 | } 39 | if (this.insanity_intervall_id) { 40 | clearInterval(this.insanity_intervall_id); 41 | this.insanity_intervall_id = null; 42 | } 43 | }; 44 | return CountdownToInsanity; 45 | })(); 46 | Insanity.CountdownToInsanity = CountdownToInsanity; 47 | })(Insanity || (Insanity = {})); 48 | /// 49 | var countdown_element = document.getElementById('countdown_display'); 50 | var countdown_helper = new Insanity.CountdownToInsanity(countdown_element); 51 | countdown_helper.start(); 52 | var stop_element = document.getElementById('stop'); 53 | stop_element.onclick = function () { countdown_helper.stop(); }; 54 | // this is another source file 55 | // there are no references to this file from other files mentioned in tsconfig.json[files] 56 | // -> so this file has to be mentioned in tsconfig.json[files] to be compiled 57 | // in contrast: insanity.ts is compiled automatically, because it is referenced in main.ts 58 | // but it would be no harm, if insanity.ts would also be mentioned in tsconfig.json 59 | window.main_two_has_been_executed = true; 60 | //# sourceMappingURL=mycode.js.map -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sigmund", 3 | "version": "1.0.0", 4 | "description": "Quick and dirty signatures for Objects.", 5 | "main": "sigmund.js", 6 | "directories": { 7 | "test": "test" 8 | }, 9 | "dependencies": {}, 10 | "devDependencies": { 11 | "tap": "~0.3.0" 12 | }, 13 | "scripts": { 14 | "test": "tap test/*.js", 15 | "bench": "node bench.js" 16 | }, 17 | "repository": { 18 | "type": "git", 19 | "url": "git://github.com/isaacs/sigmund" 20 | }, 21 | "keywords": [ 22 | "object", 23 | "signature", 24 | "key", 25 | "data", 26 | "psychoanalysis" 27 | ], 28 | "author": { 29 | "name": "Isaac Z. Schlueter", 30 | "email": "i@izs.me", 31 | "url": "http://blog.izs.me/" 32 | }, 33 | "license": "BSD", 34 | "readme": "# sigmund\n\nQuick and dirty signatures for Objects.\n\nThis is like a much faster `deepEquals` comparison, which returns a\nstring key suitable for caches and the like.\n\n## Usage\n\n```javascript\nfunction doSomething (someObj) {\n var key = sigmund(someObj, maxDepth) // max depth defaults to 10\n var cached = cache.get(key)\n if (cached) return cached)\n\n var result = expensiveCalculation(someObj)\n cache.set(key, result)\n return result\n}\n```\n\nThe resulting key will be as unique and reproducible as calling\n`JSON.stringify` or `util.inspect` on the object, but is much faster.\nIn order to achieve this speed, some differences are glossed over.\nFor example, the object `{0:'foo'}` will be treated identically to the\narray `['foo']`.\n\nAlso, just as there is no way to summon the soul from the scribblings\nof a cocain-addled psychoanalyst, there is no way to revive the object\nfrom the signature string that sigmund gives you. In fact, it's\nbarely even readable.\n\nAs with `sys.inspect` and `JSON.stringify`, larger objects will\nproduce larger signature strings.\n\nBecause sigmund is a bit less strict than the more thorough\nalternatives, the strings will be shorter, and also there is a\nslightly higher chance for collisions. For example, these objects\nhave the same signature:\n\n var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]}\n var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']}\n\nLike a good Freudian, sigmund is most effective when you already have\nsome understanding of what you're looking for. It can help you help\nyourself, but you must be willing to do some work as well.\n\nCycles are handled, and cyclical objects are silently omitted (though\nthe key is included in the signature output.)\n\nThe second argument is the maximum depth, which defaults to 10,\nbecause that is the maximum object traversal depth covered by most\ninsurance carriers.\n", 35 | "readmeFilename": "README.md", 36 | "bugs": { 37 | "url": "https://github.com/isaacs/sigmund/issues" 38 | }, 39 | "homepage": "https://github.com/isaacs/sigmund", 40 | "_id": "sigmund@1.0.0", 41 | "_from": "sigmund@>=1.0.0 <1.1.0" 42 | } 43 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/test/nocase-nomagic.js: -------------------------------------------------------------------------------- 1 | var fs = require('graceful-fs'); 2 | var test = require('tap').test; 3 | var glob = require('../'); 4 | 5 | test('mock fs', function(t) { 6 | var stat = fs.stat 7 | var statSync = fs.statSync 8 | var readdir = fs.readdir 9 | var readdirSync = fs.readdirSync 10 | 11 | function fakeStat(path) { 12 | var ret 13 | switch (path.toLowerCase()) { 14 | case '/tmp': case '/tmp/': 15 | ret = { isDirectory: function() { return true } } 16 | break 17 | case '/tmp/a': 18 | ret = { isDirectory: function() { return false } } 19 | break 20 | } 21 | return ret 22 | } 23 | 24 | fs.stat = function(path, cb) { 25 | var f = fakeStat(path); 26 | if (f) { 27 | process.nextTick(function() { 28 | cb(null, f) 29 | }) 30 | } else { 31 | stat.call(fs, path, cb) 32 | } 33 | } 34 | 35 | fs.statSync = function(path) { 36 | return fakeStat(path) || statSync.call(fs, path) 37 | } 38 | 39 | function fakeReaddir(path) { 40 | var ret 41 | switch (path.toLowerCase()) { 42 | case '/tmp': case '/tmp/': 43 | ret = [ 'a', 'A' ] 44 | break 45 | case '/': 46 | ret = ['tmp', 'tMp', 'tMP', 'TMP'] 47 | } 48 | return ret 49 | } 50 | 51 | fs.readdir = function(path, cb) { 52 | var f = fakeReaddir(path) 53 | if (f) 54 | process.nextTick(function() { 55 | cb(null, f) 56 | }) 57 | else 58 | readdir.call(fs, path, cb) 59 | } 60 | 61 | fs.readdirSync = function(path) { 62 | return fakeReaddir(path) || readdirSync.call(fs, path) 63 | } 64 | 65 | t.pass('mocked') 66 | t.end() 67 | }) 68 | 69 | test('nocase, nomagic', function(t) { 70 | var n = 2 71 | var want = [ '/TMP/A', 72 | '/TMP/a', 73 | '/tMP/A', 74 | '/tMP/a', 75 | '/tMp/A', 76 | '/tMp/a', 77 | '/tmp/A', 78 | '/tmp/a' ] 79 | glob('/tmp/a', { nocase: true }, function(er, res) { 80 | if (er) 81 | throw er 82 | t.same(res.sort(), want) 83 | if (--n === 0) t.end() 84 | }) 85 | glob('/tmp/A', { nocase: true }, function(er, res) { 86 | if (er) 87 | throw er 88 | t.same(res.sort(), want) 89 | if (--n === 0) t.end() 90 | }) 91 | }) 92 | 93 | test('nocase, with some magic', function(t) { 94 | t.plan(2) 95 | var want = [ '/TMP/A', 96 | '/TMP/a', 97 | '/tMP/A', 98 | '/tMP/a', 99 | '/tMp/A', 100 | '/tMp/a', 101 | '/tmp/A', 102 | '/tmp/a' ] 103 | glob('/tmp/*', { nocase: true }, function(er, res) { 104 | if (er) 105 | throw er 106 | t.same(res.sort(), want) 107 | }) 108 | glob('/tmp/*', { nocase: true }, function(er, res) { 109 | if (er) 110 | throw er 111 | t.same(res.sort(), want) 112 | }) 113 | }) 114 | -------------------------------------------------------------------------------- /lib/test/test_project.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | import sublime, sys, os 4 | from ArcticTypescript.lib.ArcticTestCase import ArcticTestCase 5 | from sublime_unittest import TestCase 6 | from unittest.mock import MagicMock as MM 7 | 8 | Project = sys.modules["ArcticTypescript.lib.system.Project"] 9 | 10 | class test_project_opening(ArcticTestCase): 11 | 12 | def setUp(self): 13 | # No settings or other files 14 | self.clear_files_except_sublimeproject() 15 | #self.assert_no_typescript_project_settings() 16 | 17 | 18 | def test_opening_ts_file_should_trigger_dialog_if_no_project_settings(self): 19 | """ Dialog is only shown when no .sublimets or *.sublime-project is found 20 | or if these files do not specify any root files""" 21 | 22 | return 23 | # mock show method 24 | tmp_show = Project.ProjectError.show 25 | Project.ProjectError.show = MM() 26 | 27 | self.create_ts_file() 28 | self.open_and_focus_tsfile() 29 | 30 | yield 10 # pause 10 ms 31 | 32 | self.assertTrue(Project.ProjectError.show.called) 33 | 34 | # reset mocked method 35 | Project.ProjectError.show = tmp_show 36 | self.close_view() 37 | self.rm_file() 38 | 39 | 40 | def test_opening_ts_file_should_init_project(self): 41 | self.create_settings() 42 | self.create_ts_file() 43 | 44 | tmp_init = Project.OpenedProject.__init__ 45 | Project.OpenedProject.__init__ = MM() 46 | 47 | self.open_and_focus_tsfile() 48 | 49 | yield 10 50 | 51 | self.assertTrue(Project.OpenedProject.__init__) 52 | 53 | # reset mocked method 54 | Project.OpenedProject.__init__ = tmp_init 55 | #self.close_view() 56 | #self.rm_file() 57 | 58 | 59 | 60 | def test_opening_ts_file_should_create_projectclass(self): 61 | pass 62 | #sublime.active_window().project_data() 63 | #x = Project.project_by_view(1) 64 | #self.assertEqual(x, 13) 65 | 66 | # for testing sublime command 67 | 68 | class test_helloworld_command(TestCase): 69 | 70 | def setUp(self): 71 | self.view = sublime.active_window().new_file() 72 | 73 | def tearDown(self): 74 | if self.view: 75 | self.view.set_scratch(True) 76 | self.view.window().focus_view(self.view) 77 | self.view.window().run_command("close_file") 78 | 79 | def setText(self, string): 80 | pass 81 | #self.view.run_command("insert", {"characters": string}) 82 | 83 | def getRow(self, row): 84 | return self.view.substr(self.view.line(self.view.text_point(row,0))) 85 | 86 | def test_hello_world_st3(self): 87 | #self.view.run_command("hello_world") 88 | first_row = self.getRow(0) 89 | #self.assertEqual(first_row,"hello world") 90 | 91 | def test_hello_world(self): 92 | self.setText("new ") 93 | #self.view.run_command("hello_world") 94 | first_row = self.getRow(0) 95 | #self.assertEqual(first_row,"new hello world") 96 | 97 | 98 | Project = sys.modules["ArcticTypescript.lib.system.Project"] 99 | 100 | class test_internal_functions(TestCase): 101 | def test_foo(self): 102 | x = Project.project_by_view(1) 103 | self.assertEqual(x, 13) 104 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/Gruntfile.coffee: -------------------------------------------------------------------------------- 1 | # requires grunt 0.4.x 2 | sourceDir = "source/code" 3 | buildDir = "build/code" 4 | sourceSpecDir = "source/spec" 5 | buildSpecDir = "build/spec" 6 | 7 | gruntFunction = (grunt) -> 8 | _ = grunt.util._ 9 | 10 | gruntConfig = 11 | pkg: grunt.file.readJSON('package.json') 12 | 13 | meta: 14 | banner: """ 15 | /*! 16 | * <%= pkg.name %> - version <%= pkg.version %> 17 | * Compiled on <%= grunt.template.today(\"yyyy-mm-dd\") %> 18 | * <%= pkg.repository.url %> 19 | * Copyright(c) <%= grunt.template.today(\"yyyy\") %> <%= pkg.author.name %> (<%= pkg.author.email %> ) 20 | * Licensed <%= pkg.licenses[0].type %> <%= pkg.licenses[0].url %> 21 | */\n 22 | """ 23 | varVERSION: "var VERSION = '<%= pkg.version %>'; //injected by grunt:concat\n" 24 | mdVersion: "# <%= pkg.name %> v<%= pkg.version %>\n" 25 | usrBinEnvNode: "#!/usr/bin/env node\n" 26 | 27 | options: {sourceDir, buildDir, sourceSpecDir, buildSpecDir} 28 | 29 | shell: 30 | coffee: 31 | command: "coffee -cb -o ./#{buildDir} ./#{sourceDir}" 32 | 33 | coffeeSpec: 34 | command: "coffee -cb -o ./#{buildSpecDir} ./#{sourceSpecDir}" 35 | 36 | coffeeWatch: 37 | command: "coffee -cbw -o ./build ./source" 38 | 39 | mocha: 40 | command: "mocha #{buildSpecDir} --recursive --bail --reporter spec" 41 | 42 | options: # subtasks inherit options but can override them 43 | verbose: true 44 | failOnError: true 45 | stdout: true 46 | stderr: true 47 | 48 | concat: 49 | VERSIONindex: 50 | options: banner: "<%= meta.banner %><%= meta.varVERSION %>" 51 | src: [ '<%= options.buildDir %>/expand.js'] 52 | dest: '<%= options.buildDir %>/expand.js' 53 | 54 | clean: 55 | build: [ 56 | "<%= options.buildDir %>/**/*.*" 57 | "<%= options.buildSpecDir %>/**/*.*" 58 | ] 59 | 60 | ### shortcuts generation ### 61 | splitTasks = (tasks)-> if !_.isString tasks then tasks else (_.filter tasks.split(' '), (v)-> v) 62 | 63 | grunt.registerTask cmd, splitTasks "shell:#{cmd}" for cmd of gruntConfig.shell # shortcut to all "shell:cmd" 64 | 65 | grunt.registerTask shortCut, splitTasks tasks for shortCut, tasks of { 66 | "default": "clean build" 67 | "build": "shell:coffee concat" 68 | "test": "mocha" 69 | 70 | # some shortcuts 71 | "cf": "shell:coffee" 72 | "cfw": "shell:coffeeWatch" 73 | 74 | # generic shortcuts 75 | "cl": "clean" 76 | "b": "build" 77 | "d": "deploy" 78 | "m": "mocha" 79 | "t": "test" 80 | 81 | # IDE shortcuts 82 | "alt-c": "cp" 83 | "alt-b": "b" 84 | "alt-d": "d" 85 | "alt-t": "t" 86 | } 87 | 88 | grunt.initConfig gruntConfig 89 | grunt.loadNpmTasks 'grunt-contrib-clean' 90 | grunt.loadNpmTasks 'grunt-contrib-concat' 91 | grunt.loadNpmTasks 'grunt-shell' 92 | 93 | null 94 | 95 | # debug : call with a dummy 'grunt', that spits params on console.log 96 | #gruntFunction 97 | # initConfig: (cfg)-> console.log 'grunt: initConfig\n', JSON.stringify cfg, null, ' ' 98 | # loadNpmTasks: (tsk)-> console.log 'grunt: registerTask: ', tsk 99 | # registerTask: (shortCut, task)-> console.log 'grunt: registerTask:', shortCut, task 100 | 101 | module.exports = gruntFunction -------------------------------------------------------------------------------- /bin/node_modules/typescript/ThirdPartyNoticeText.txt: -------------------------------------------------------------------------------- 1 | /*!----------------- TypeScript ThirdPartyNotices ------------------------------------------------------- 2 | 3 | The TypeScript software is based on or incorporates material and code from the projects listed below 4 | (collectively "Third Party Code"). Microsoft is not the original author of the 5 | Third Party Code. The original copyright notice and the license, under which 6 | Microsoft received such Third Party Code, are set forth below. Such license and 7 | notices are provided for informational purposes only. Microsoft licenses the Third 8 | Party Code to you under the terms of the Apache 2.0 License. 9 | All Third Party Code licensed by Microsoft under the Apache License, Version 2.0 (the "License"); you 10 | may not use this file except in compliance with the License. You may obtain a copy 11 | of the License at http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 14 | EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR 15 | CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. 16 | 17 | See the Apache Version 2.0 License for specific language governing permissions and 18 | limitations under the License. 19 | --------------------------------------------- 20 | Third Party Code Components 21 | -------------------------------------------- 22 | 23 | ------------------- DefinitelyTyped -------------------- 24 | This file is based on or incorporates material from the projects listed below (collectively ?Third Party Code?). Microsoft is not the original author of the Third Party Code. The original copyright notice and the license, under which Microsoft received such Third Party Code, are set forth below. Such licenses and notices are provided for informational purposes only. Microsoft, not the third party, licenses the Third Party Code to you under the terms set forth in the EULA for the Microsoft Product. Microsoft reserves all other rights not expressly granted under this agreement, whether by implication, estoppel or otherwise. 25 | DefinitelyTyped 26 | This project is licensed under the MIT license. 27 | Copyrights are respective of each contributor listed at the beginning of each definition file. 28 | Provided for Informational Purposes Only 29 | 30 | MIT License 31 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 32 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 33 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 34 | -------------------------------------------------------------------------------------- 35 | ------------- End of ThirdPartyNotices --------------------------------------------------- */ 36 | -------------------------------------------------------------------------------- /lib/system/ErrorsHighlighter.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | from threading import Thread 4 | 5 | import sublime 6 | import os 7 | import json 8 | 9 | from ..utils import package_path, max_calls 10 | from ..utils.fileutils import fn2k, is_ts 11 | 12 | # ----------------------------------- ERROR HIGHTLIGHTER -------------------------------------- # 13 | 14 | class ErrorsHighlighter(object): 15 | 16 | # Constants 17 | underline = sublime.DRAW_SQUIGGLY_UNDERLINE | sublime.DRAW_NO_FILL | sublime.DRAW_NO_OUTLINE | sublime.DRAW_EMPTY_AS_OVERWRITE 18 | 19 | 20 | def __init__(self, project): 21 | self.project = project 22 | self._icon_paths() 23 | 24 | 25 | def _icon_paths(self): 26 | """ defines paths for icons """ 27 | if os.name == 'nt': 28 | self.error_icon = ".."+os.path.join(package_path.split('Packages')[1], 'icons', 'bright-illegal') 29 | self.warning_icon = ".."+os.path.join(package_path.split('Packages')[1], 'icons', 'bright-warning') 30 | else: 31 | self.error_icon = "Packages"+os.path.join(package_path.split('Packages')[1], 'icons', 'bright-illegal.png') 32 | self.warning_icon = "Packages"+os.path.join(package_path.split('Packages')[1], 'icons', 'bright-warning.png') 33 | 34 | 35 | @max_calls(name='Errors.highlight') 36 | def highlight_all_open_files(self): 37 | """ update hightlights (red underline) in all files, using the errors in project """ 38 | 39 | self.errors = {} 40 | 41 | # iterate through all open views, to remove all remaining outdated underlinings 42 | for window in sublime.windows(): 43 | for view in window.views(): 44 | if is_ts(view): 45 | error_regions, warning_regions, error_texts = \ 46 | self.project.errors.tssjs_to_highlighter(view) 47 | 48 | self.errors[fn2k(view.file_name())] = error_texts 49 | 50 | # apply regions, even if empty (that will remove every highlight in that file) 51 | view.add_regions('typescript-error' , error_regions , 'invalid' , self.error_icon, self.underline) 52 | view.add_regions('typescript-warnings' , warning_regions , 'invalid' , self.warning_icon, self.underline) 53 | 54 | 55 | previously_error_under_cursor = False 56 | 57 | @max_calls(name='ErrorHighlighter.display_error_in_status_if_cursor') 58 | def display_error_in_status_if_cursor(self, view): 59 | """ 60 | Displays the error message in the sublime status 61 | line if the cursor is above an error (in source code). 62 | For the click on the error list, see T3SVIEWS.ERROR.on_click() 63 | """ 64 | try: 65 | error = self._get_error_at(view.sel()[0].begin(), view.file_name()) 66 | except: 67 | # no selection in view 68 | return 69 | if error is not None: 70 | sublime.status_message(error) 71 | self.previously_error_under_cursor = True 72 | elif self.previously_error_under_cursor: # only clear once 73 | sublime.status_message('') 74 | self.previously_error_under_cursor = False 75 | 76 | 77 | def _get_error_at(self, pos, filename): 78 | """ Returns the error at pos in filename """ 79 | if fn2k(filename) in self.errors: 80 | for (start, end), error_msg in self.errors[fn2k(filename)].items(): 81 | if pos >= start and pos <= end: 82 | return error_msg 83 | 84 | return None 85 | 86 | 87 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/README.md: -------------------------------------------------------------------------------- 1 | # lru cache 2 | 3 | A cache object that deletes the least-recently-used items. 4 | 5 | ## Usage: 6 | 7 | ```javascript 8 | var LRU = require("lru-cache") 9 | , options = { max: 500 10 | , length: function (n) { return n * 2 } 11 | , dispose: function (key, n) { n.close() } 12 | , maxAge: 1000 * 60 * 60 } 13 | , cache = LRU(options) 14 | , otherCache = LRU(50) // sets just the max size 15 | 16 | cache.set("key", "value") 17 | cache.get("key") // "value" 18 | 19 | cache.reset() // empty the cache 20 | ``` 21 | 22 | If you put more stuff in it, then items will fall out. 23 | 24 | If you try to put an oversized thing in it, then it'll fall out right 25 | away. 26 | 27 | ## Options 28 | 29 | * `max` The maximum size of the cache, checked by applying the length 30 | function to all values in the cache. Not setting this is kind of 31 | silly, since that's the whole purpose of this lib, but it defaults 32 | to `Infinity`. 33 | * `maxAge` Maximum age in ms. Items are not pro-actively pruned out 34 | as they age, but if you try to get an item that is too old, it'll 35 | drop it and return undefined instead of giving it to you. 36 | * `length` Function that is used to calculate the length of stored 37 | items. If you're storing strings or buffers, then you probably want 38 | to do something like `function(n){return n.length}`. The default is 39 | `function(n){return 1}`, which is fine if you want to store `n` 40 | like-sized things. 41 | * `dispose` Function that is called on items when they are dropped 42 | from the cache. This can be handy if you want to close file 43 | descriptors or do other cleanup tasks when items are no longer 44 | accessible. Called with `key, value`. It's called *before* 45 | actually removing the item from the internal cache, so if you want 46 | to immediately put it back in, you'll have to do that in a 47 | `nextTick` or `setTimeout` callback or it won't do anything. 48 | * `stale` By default, if you set a `maxAge`, it'll only actually pull 49 | stale items out of the cache when you `get(key)`. (That is, it's 50 | not pre-emptively doing a `setTimeout` or anything.) If you set 51 | `stale:true`, it'll return the stale value before deleting it. If 52 | you don't set this, then it'll return `undefined` when you try to 53 | get a stale entry, as if it had already been deleted. 54 | 55 | ## API 56 | 57 | * `set(key, value)` 58 | * `get(key) => value` 59 | 60 | Both of these will update the "recently used"-ness of the key. 61 | They do what you think. 62 | 63 | * `peek(key)` 64 | 65 | Returns the key value (or `undefined` if not found) without 66 | updating the "recently used"-ness of the key. 67 | 68 | (If you find yourself using this a lot, you *might* be using the 69 | wrong sort of data structure, but there are some use cases where 70 | it's handy.) 71 | 72 | * `del(key)` 73 | 74 | Deletes a key out of the cache. 75 | 76 | * `reset()` 77 | 78 | Clear the cache entirely, throwing away all values. 79 | 80 | * `has(key)` 81 | 82 | Check if a key is in the cache, without updating the recent-ness 83 | or deleting it for being stale. 84 | 85 | * `forEach(function(value,key,cache), [thisp])` 86 | 87 | Just like `Array.prototype.forEach`. Iterates over all the keys 88 | in the cache, in order of recent-ness. (Ie, more recently used 89 | items are iterated over first.) 90 | 91 | * `keys()` 92 | 93 | Return an array of the keys in the cache. 94 | 95 | * `values()` 96 | 97 | Return an array of the values in the cache. 98 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "glob-expand", 3 | "description": "A sync glob / minimatch / RegExp call with a gruntjs -like `expand` of patterns, with minimum depepndencies. Derived from gruntjs's v0.4.1 `file.expand`", 4 | "version": "0.0.2", 5 | "homepage": "https://github.com/anodynos/node-glob-expand", 6 | "author": { 7 | "name": "Agelos Pikoulas", 8 | "email": "agelos.pikoulas@gmail.com" 9 | }, 10 | "licenses": [ 11 | { 12 | "type": "MIT", 13 | "url": "http://www.opensource.org/licenses/mit-license.php" 14 | } 15 | ], 16 | "keywords": [ 17 | "minimatch", 18 | "glob", 19 | "node-glob", 20 | "gruntjs", 21 | "grunt", 22 | "expand", 23 | "filematch", 24 | "wildcards", 25 | "patterns" 26 | ], 27 | "repository": { 28 | "type": "git", 29 | "url": "git://github.com/anodynos/node-glob-expand" 30 | }, 31 | "bugs": { 32 | "url": "" 33 | }, 34 | "main": "./build/code/expand.js", 35 | "test": "mocha build/spec --recursive --bail --reporter spec", 36 | "directories": { 37 | "doc": "./doc", 38 | "dist": "./build" 39 | }, 40 | "engines": { 41 | "node": "*" 42 | }, 43 | "dependencies": { 44 | "glob": "~3.1.21", 45 | "lodash": "1.2.x" 46 | }, 47 | "devDependencies": { 48 | "chai": "*", 49 | "grunt": "0.4.1", 50 | "grunt-contrib-concat": "0.3.0", 51 | "grunt-contrib-clean": "0.4.1", 52 | "grunt-shell": "0.2.2" 53 | }, 54 | "readme": "# glob-expand\n\nA (sync) glob / minimatch / RegExp call using [gruntjs](https://github.com/gruntjs/grunt)'s `file.expand`.\n\nIt has only a minimum of dependencies (glob & lodash).\n\nIts almost a copy/paste of 2 functions from Gruntjs's v0.4.1 [grunt/file.js](https://github.com/gruntjs/grunt/blob/master/lib/grunt/file.js)\n\nAdditionally you can use [minimatch](http://github.com/isaacs/minimatch/) `String`s or `RegExp`s, either as an Array or as arguments.\n*\n\n## Install:\n\n`npm install glob-expand`\n\n## Examples:\n```coffeescript\n\texpand = require 'glob-expand'\n\n\t# may the original node-glob be with you (should you need it):\n\tglob = expand.glob\n\n\texpand {filter: 'isFile', cwd: '../'}, ['**/*.*', '!exclude/these/**/*.*']\n\t# returns all files in cwd ['file1', 'file2',...] but excluding\n\t# those under directory 'exclude/these'\n\n\t# These are the same\n\texpand {cwd: '../..'}, ['**/*.*', '!node_modules/**/*.*']\n\texpand {cwd: '../..'}, '**/*.*', '!node_modules/**/*.*'\n\n\t# These are the same too:\n\texpand {}, ['**/*.*', '!**/*.js']\n\texpand {}, '**/*.*', '!**/*.js'\n\texpand ['**/*.*', '!**/*.js']\n\texpand '**/*.*', '!**/*.js'\n\n\t# Using Regular Expressions:\n\texpand '**/*.js', /.*\\.(coffee\\.md|litcoffee|coffee)$/i, '!DRAFT*.*'\n\t# -> returns all `.js`, `.coffee`, `.coffee.md` & `.litcoffee` files,\n\t# excluding those starting with 'DRAFT'\n\n```\n\nSee [gruntjs files configuration](http://gruntjs.com/configuring-tasks#files)\nand [node-glob](https://github.com/isaacs/node-glob) for more options.\n\nSorry no tests, I assumed gruntjs's tests are sufficient ;-)", 55 | "_id": "glob-expand@0.0.2", 56 | "dist": { 57 | "shasum": "00b11cb522f808c4d0364a5617e1b9f80488e5e8", 58 | "tarball": "http://registry.npmjs.org/glob-expand/-/glob-expand-0.0.2.tgz" 59 | }, 60 | "_npmVersion": "1.1.63", 61 | "_npmUser": { 62 | "name": "anodynos", 63 | "email": "agelos.pikoulas@gmail.com" 64 | }, 65 | "maintainers": [ 66 | { 67 | "name": "anodynos", 68 | "email": "agelos.pikoulas@gmail.com" 69 | } 70 | ], 71 | "_shasum": "00b11cb522f808c4d0364a5617e1b9f80488e5e8", 72 | "_resolved": "https://registry.npmjs.org/glob-expand/-/glob-expand-0.0.2.tgz", 73 | "_from": "glob-expand@0.0.2" 74 | } 75 | -------------------------------------------------------------------------------- /bin/harness.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft, Claus Reinke. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. 3 | // See LICENSE.txt in the project root for complete license information. 4 | /// 5 | /// 6 | /// 7 | var ts = require("typescript"); 8 | var ScriptInfo = (function () { 9 | function ScriptInfo(fileName, content, isOpen) { 10 | if (isOpen === void 0) { isOpen = true; } 11 | this.fileName = fileName; 12 | this.content = content; 13 | this.isOpen = isOpen; 14 | this.version = 1; 15 | this.editRanges = []; 16 | this.lineMap = null; 17 | this.setContent(content); 18 | } 19 | ScriptInfo.prototype.setContent = function (content) { 20 | this.content = content; 21 | this.lineMap = ts.computeLineStarts(content); 22 | }; 23 | ScriptInfo.prototype.updateContent = function (content) { 24 | var old_length = this.content.length; 25 | this.setContent(content); 26 | this.editRanges.push({ 27 | length: content.length, 28 | textChangeRange: 29 | // NOTE: no shortcut for "update everything" (null only works in some places, #10) 30 | ts.createTextChangeRange(ts.createTextSpan(0, old_length), content.length) 31 | }); 32 | this.version++; 33 | }; 34 | ScriptInfo.prototype.editContent = function (minChar, limChar, newText) { 35 | // Apply edits 36 | var prefix = this.content.substring(0, minChar); 37 | var middle = newText; 38 | var suffix = this.content.substring(limChar); 39 | this.setContent(prefix + middle + suffix); 40 | // Store edit range + new length of script 41 | this.editRanges.push({ 42 | length: this.content.length, 43 | textChangeRange: ts.createTextChangeRange(ts.createTextSpanFromBounds(minChar, limChar), newText.length) 44 | }); 45 | // Update version # 46 | this.version++; 47 | }; 48 | ScriptInfo.prototype.getTextChangeRangeBetweenVersions = function (startVersion, endVersion) { 49 | if (startVersion === endVersion) { 50 | // No edits! 51 | return ts.unchangedTextChangeRange; 52 | } 53 | var initialEditRangeIndex = this.editRanges.length - (this.version - startVersion); 54 | var lastEditRangeIndex = this.editRanges.length - (this.version - endVersion); 55 | var entries = this.editRanges.slice(initialEditRangeIndex, lastEditRangeIndex); 56 | return ts.collapseTextChangeRangesAcrossMultipleVersions(entries.map(function (e) { return e.textChangeRange; })); 57 | }; 58 | return ScriptInfo; 59 | })(); 60 | exports.ScriptInfo = ScriptInfo; 61 | var ScriptSnapshot = (function () { 62 | function ScriptSnapshot(scriptInfo) { 63 | this.scriptInfo = scriptInfo; 64 | this.lineMap = null; 65 | this.textSnapshot = scriptInfo.content; 66 | this.version = scriptInfo.version; 67 | } 68 | ScriptSnapshot.prototype.getText = function (start, end) { 69 | return this.textSnapshot.substring(start, end); 70 | }; 71 | ScriptSnapshot.prototype.getLength = function () { 72 | return this.textSnapshot.length; 73 | }; 74 | ScriptSnapshot.prototype.getLineStartPositions = function () { 75 | if (this.lineMap === null) { 76 | this.lineMap = ts.computeLineStarts(this.textSnapshot); 77 | } 78 | return this.lineMap; 79 | }; 80 | ScriptSnapshot.prototype.getChangeRange = function (oldSnapshot) { 81 | return undefined; 82 | }; 83 | return ScriptSnapshot; 84 | })(); 85 | exports.ScriptSnapshot = ScriptSnapshot; 86 | -------------------------------------------------------------------------------- /lib/utils/pathutils.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | import os 4 | import sys 5 | 6 | from .fileutils import file_exists 7 | from .utils import replace_variables 8 | from .debug import Debug 9 | 10 | 11 | # PACKAGE PATH 12 | package_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')) 13 | 14 | 15 | def add_usr_local_bin_to_path_on_osx(): 16 | """ OBSOLETE 17 | Adds /usr/local/bin to path on mac osx, because that is 18 | where nodejs lives. 19 | This function has not worked out its intension. Popen does not 20 | use this PATH as a search base for the executable. 21 | default_node_path() is back to it's previous state.""" 22 | if os.environ.get('PATH') and sys.platform == 'darwin': 23 | if '/usr/local/bin' in os.environ.get('PATH').split(':'): 24 | os.environ['PATH'] = os.environ.get('PATH') + ":'/usr/local/bin'" 25 | 26 | def find_tsconfigdir(rootdir): 27 | """ Returns the normalized dir, in which the tsconfig.json file is located""" 28 | rootdir = os.path.abspath(rootdir) 29 | try: 30 | if file_exists(os.path.join(rootdir, "tsconfig.json")): 31 | return os.path.normcase(rootdir) 32 | except FileNotFoundError: 33 | pass 34 | 35 | parentdir = os.path.abspath(os.path.join(rootdir, os.pardir)) 36 | if parentdir == rootdir: 37 | return None 38 | else: 39 | return find_tsconfigdir(parentdir) 40 | 41 | 42 | def expand_variables(path, project=None, use_cache=False): 43 | variables = {} 44 | if project is not None: 45 | variables.update(project.extract_variables(use_cache)) 46 | return replace_variables(path, variables) 47 | 48 | 49 | # GET TSS PATH 50 | def get_tss_path(): 51 | """ Return path to tss.js """ 52 | return os.path.join(package_path, 'bin', 'tss.js') 53 | 54 | # GET TSS PATH 55 | def get_expandglob_path(): 56 | """ Return path to expandglob.js """ 57 | return os.path.join(package_path, 'bin', 'expandglob.js') 58 | 59 | 60 | def default_node_path(node_path, project=None): 61 | if node_path == 'none': 62 | Debug('notify', 'The setting node_path is set to "none". That is depreciated. Remove the setting.') 63 | node_path = None 64 | 65 | if node_path == "" or node_path is None: 66 | if sys.platform == "linux": 67 | return "nodejs" 68 | elif sys.platform == "nt": 69 | return "node" 70 | elif sys.platform == "darwin": 71 | return "/usr/local/bin/node" 72 | else: 73 | return "node" 74 | else: 75 | return expand_variables(node_path, project) 76 | 77 | 78 | def default_tsc_path(tsc_path=None, project=None): 79 | if tsc_path is not None and tsc_path: 80 | tsc_path = expand_variables(tsc_path, project) 81 | return tsc_path 82 | 83 | # search node_modules 84 | if project: 85 | node_modules_dir = search_node_modules(project.tsconfigdir) 86 | if node_modules_dir: 87 | tsc_path = os.path.join(node_modules_dir, ".bin", "tsc") 88 | if file_exists(tsc_path): 89 | return os.path.normcase(tsc_path) 90 | 91 | # use ArcticTypescript's tsc 92 | return os.path.join(package_path, 'bin', 'node_modules', 'typescript', 'bin', 'tsc') 93 | 94 | 95 | 96 | def search_node_modules(rootdir): 97 | rootdir = os.path.abspath(rootdir) 98 | try: 99 | nodemodulesdir = os.path.normcase(os.path.join(rootdir, "node_modules")) 100 | if os.path.isdir(nodemodulesdir): 101 | return os.path.normcase(nodemodulesdir) 102 | except FileNotFoundError: 103 | pass 104 | 105 | parentdir = os.path.abspath(os.path.join(rootdir, os.pardir)) 106 | if parentdir == rootdir: 107 | return None 108 | else: 109 | return search_node_modules(parentdir) 110 | -------------------------------------------------------------------------------- /lib/utils/debug.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | import sys 4 | from functools import wraps 5 | 6 | 7 | # Use this to start a visual debugger (PluginDebugger (a sublime plugin) and 8 | # winpdb must be installed) 9 | # import spdb ; spdb.start() 10 | 11 | # Commands for python console 12 | # import ArcticTypescript.lib as a 13 | # first project: 14 | # p = a.system.globals.OPENED_PROJECTS.values().__iter__().__next__() 15 | # print indexed files: 16 | # p.tsserver.get_tss_indexed_files(lambda a:print(a)) 17 | # p.tsserver.dump("c:/users/danie_000/amd_modules_with_tests/src/app.ts", 'C:/users/danie_000/dump3.txt', print) 18 | # error recalculation: 19 | # p.tsserver.executed_with_most_recent_file_contents = [] 20 | # p.errors.start_recalculation() 21 | # p.tsserver.reload() 22 | 23 | # TypescriptToolsWrapper.eva() -> evaluates javascript command in tss.js 24 | # p.tsserver.eva('_this') 25 | # p.tsserver.last_eva 26 | # But needs this code in tss.js (add manually below the command checks before using eva() for debugging) 27 | # else if (m = match(cmd, /^eva ([\s\S]*)$/)) { 28 | # if (m[1]) { 29 | # var res = eval(m[1]); 30 | # res = JSON.stringify(res); //.replace(/\n/g, '
').replace(/"/g, '\''); 31 | # _this.outputJSON('' + res + ''); 32 | # } 33 | # else 34 | # _this.outputJSON('"no input"'); 35 | # } 36 | 37 | 38 | # ####################### DEFINE LIST OF DISPLAYED DEBUG MESSAGES ############## 39 | 40 | # notify, tsconfig.json and error should be enabled in production 41 | print_classifications = ['notify', 'error', 'tsconfig.json'] 42 | 43 | 44 | # ####################### Possible classifications ############################# 45 | 46 | possible_classifications = [ 'all', 'notify', 'error', 47 | 'tss', 'tss+', 'tss++', 48 | 'command', 'command+', 49 | 'adapter', 'adapter+', 50 | 'files', 51 | 'build', 'build+', 52 | 'structure', 53 | 'refactor', 54 | 'autocomplete', 55 | 'errorpanel', 'errorpanel+', 56 | 'focus', 'max_calls', 57 | 'layout', 58 | 'goto', 59 | 'project', 'project+', 60 | 'tsconfig', 'tsconfig.json'] 61 | 62 | 63 | # ####################### DEBUG logger ######################################### 64 | 65 | 66 | def Debug(classification, text): 67 | if 'all' in print_classifications or classification in print_classifications: 68 | print("ArcticTypescript: %s: %s" % (classification.ljust(8), text)) 69 | if classification not in possible_classifications: 70 | print("ArcticTypescript: debug: got unknown debug message classification: %s. " \ 71 | "Consider adding this to possible_classifications" % classification) 72 | sys.stdout.flush() 73 | 74 | 75 | # ####################### log number of calls to funcitons ##################### 76 | # HELPER to hunt down memory leak 77 | 78 | def max_calls(limit = 1500, name=""): 79 | """Decorator which allows its wrapped function to be called `limit` times""" 80 | def decorator(func): 81 | # Disable limit: 82 | return func 83 | @wraps(func) 84 | def wrapper(*args, **kwargs): 85 | calls = getattr(wrapper, 'calls', 0) 86 | calls += 1 87 | setattr(wrapper, 'calls', calls) 88 | fname = name if name != "" else func.__name__ 89 | 90 | if calls == limit + 1: 91 | Debug('max_calls', "LIMIT !! ## !!: Fkt %s has %i calls, stop" % (fname, calls - 1)) 92 | 93 | if calls >= limit + 1: 94 | return None 95 | 96 | Debug('max_calls', "CALL: Fkt %s has %i calls -> +1" % (fname, calls - 1)) 97 | 98 | return func(*args, **kwargs) 99 | setattr(wrapper, 'calls', 0) 100 | return wrapper 101 | return decorator -------------------------------------------------------------------------------- /lib/display/views/Outline.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | import sublime 4 | from .Base import Base 5 | from ...utils import Debug 6 | from ...utils.uiutils import get_prefix 7 | 8 | class Outline(Base): 9 | 10 | regions = {} 11 | ts_view = None 12 | 13 | def __init__(self, t3sviews): 14 | super(Outline, self).__init__('Typescript : Outline View', t3sviews) 15 | 16 | 17 | # SET TEXT 18 | def set_text(self, edit_token, members, ts_view): 19 | """ 20 | This function takes the tss.js members structure instead of a string. 21 | """ 22 | # this will process the outline, even if the view is closed 23 | self.ts_view = ts_view 24 | if type(members) == list: 25 | self._tssjs_2_outline_format(members) 26 | elif type(members) == str: 27 | self.text = members 28 | 29 | super(Outline, self).set_text(edit_token, self.text) 30 | 31 | def is_current_ts(self, ts_view): 32 | if ts_view is None or self.ts_view is None: 33 | return 34 | return ts_view.id() == self.ts_view.id() 35 | 36 | def _tssjs_2_outline_format(self, members): 37 | text = [] 38 | line = 0 39 | self.regions = {} 40 | 41 | for member in members: 42 | start_line = member['min']['line'] 43 | end_line = member['lim']['line'] 44 | left = member['min']['character'] 45 | right = member['lim']['character'] 46 | 47 | a = self.ts_view.text_point(start_line-1, left-1) 48 | b = self.ts_view.text_point(end_line-1, right-1) 49 | region = sublime.Region(a, b) 50 | kind = get_prefix(member['loc']['kind']) 51 | container_kind = get_prefix(member['loc']['containerKind']) 52 | if member['loc']['kindModifiers'] != "": 53 | member['loc']['kindModifiers'] = " " + member['loc']['kindModifiers'] 54 | 55 | if member['loc']['kind'] != 'class' and member['loc']['kind'] != 'interface': 56 | t = "%s %s %s %s" % (kind, member['loc']['kindModifiers'], member['loc']['kind'], member['loc']['name']) 57 | text.append('\n\t') 58 | text.append(t.strip()) 59 | line += 1 60 | self.regions[line] = region 61 | else: 62 | t = "%s %s %s %s {" % (container_kind, member['loc']['kindModifiers'], member['loc']['kind'], member['loc']['name']) 63 | if len(text) == 0: 64 | text.append('\n%s\n' % t.strip()) 65 | line += 2 66 | self.regions[line - 1] = region 67 | else: 68 | text.append('\n\n}\n\n%s\n' % t.strip()) 69 | line += 5 70 | self.regions[line - 1] = region 71 | 72 | if len(members) == 0: 73 | text.append("\n\nno members found\n") 74 | 75 | self.text = ''.join(text) 76 | 77 | 78 | is_focusing_ts_view = False 79 | 80 | def on_click(self,line): 81 | if self.is_focusing_ts_view: 82 | Debug('focus', 'Outline.on_click: is just focusing other view > ignore') 83 | return 84 | if line in self.regions: 85 | draw = sublime.DRAW_NO_FILL 86 | self.ts_view.add_regions('typescript-definition', [self.regions[line]], 'comment', 'dot', draw) 87 | self._focus_member_in_view(self.regions[line]) 88 | 89 | def _focus_member_in_view(self, region): 90 | if self.ts_view.is_loading(): 91 | return 92 | else: 93 | Debug('focus', "_focus_member_in_view, Region @pos %i" % (region.begin())) 94 | self.is_focusing_ts_view = True 95 | self.ts_view.show(region) 96 | self.ts_view.window().focus_view(self.ts_view) 97 | self.is_focusing_ts_view = False 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /bin/node_modules/typescript/README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://travis-ci.org/Microsoft/TypeScript.svg?branch=master)](https://travis-ci.org/Microsoft/TypeScript) 2 | [![Issue Stats](http://issuestats.com/github/Microsoft/TypeScript/badge/pr)](http://issuestats.com/github/microsoft/typescript) 3 | [![Issue Stats](http://issuestats.com/github/Microsoft/TypeScript/badge/issue)](http://issuestats.com/github/microsoft/typescript) 4 | [![npm version](https://badge.fury.io/js/typescript.svg)](http://badge.fury.io/js/typescript) 5 | [![Downloads](http://img.shields.io/npm/dm/TypeScript.svg)](https://npmjs.org/package/typescript) 6 | 7 | # TypeScript 8 | 9 | [TypeScript](http://www.typescriptlang.org/) is a language for application-scale JavaScript. TypeScript adds optional types, classes, and modules to JavaScript. TypeScript supports tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript. Try it out at the [playground](http://www.typescriptlang.org/Playground), and stay up to date via [our blog](http://blogs.msdn.com/typescript) and [twitter account](https://twitter.com/typescriptlang). 10 | 11 | 12 | ## Contribute 13 | 14 | There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript. 15 | * [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in. 16 | * Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls). 17 | * Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript). 18 | * Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter. 19 | * [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md). 20 | * Read the language specification ([docx](http://go.microsoft.com/fwlink/?LinkId=267121), [pdf](http://go.microsoft.com/fwlink/?LinkId=267238)). 21 | 22 | 23 | ## Documentation 24 | 25 | * [Quick tutorial](http://www.typescriptlang.org/Tutorial) 26 | * [Programming handbook](http://www.typescriptlang.org/Handbook) 27 | * [Language specification](https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md) 28 | * [Homepage](http://www.typescriptlang.org/) 29 | 30 | ## Building 31 | 32 | In order to build the TypeScript compiler, ensure that you have [Git](http://git-scm.com/downloads) and [Node.js](http://nodejs.org/) installed. 33 | 34 | Clone a copy of the repo: 35 | 36 | ``` 37 | git clone https://github.com/Microsoft/TypeScript.git 38 | ``` 39 | 40 | Change to the TypeScript directory: 41 | 42 | ``` 43 | cd TypeScript 44 | ``` 45 | 46 | Install Jake tools and dev dependencies: 47 | 48 | ``` 49 | npm install -g jake 50 | npm install 51 | ``` 52 | 53 | Use one of the following to build and test: 54 | 55 | ``` 56 | jake local # Build the compiler into built/local 57 | jake clean # Delete the built compiler 58 | jake LKG # Replace the last known good with the built one. 59 | # Bootstrapping step to be executed when the built compiler reaches a stable state. 60 | jake tests # Build the test infrastructure using the built compiler. 61 | jake runtests # Run tests using the built compiler and test infrastructure. 62 | # You can override the host or specify a test for this command. 63 | # Use host= or tests=. 64 | jake runtests-browser # Runs the tests using the built run.js file. Syntax is jake runtests. Optional 65 | parameters 'host=', 'tests=[regex], reporter=[list|spec|json|]'. 66 | jake baseline-accept # This replaces the baseline test results with the results obtained from jake runtests. 67 | jake -T # List the above commands. 68 | ``` 69 | 70 | 71 | ## Usage 72 | 73 | ```shell 74 | node built/local/tsc.js hello.ts 75 | ``` 76 | 77 | 78 | ## Roadmap 79 | 80 | For details on our planned features and future direction please refer to our [roadmap](https://github.com/Microsoft/TypeScript/wiki/Roadmap). 81 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lru-cache", 3 | "description": "A cache object that deletes the least-recently-used items.", 4 | "version": "2.5.0", 5 | "author": { 6 | "name": "Isaac Z. Schlueter", 7 | "email": "i@izs.me" 8 | }, 9 | "scripts": { 10 | "test": "tap test --gc" 11 | }, 12 | "main": "lib/lru-cache.js", 13 | "repository": { 14 | "type": "git", 15 | "url": "git://github.com/isaacs/node-lru-cache.git" 16 | }, 17 | "devDependencies": { 18 | "tap": "", 19 | "weak": "" 20 | }, 21 | "license": { 22 | "type": "MIT", 23 | "url": "http://github.com/isaacs/node-lru-cache/raw/master/LICENSE" 24 | }, 25 | "readme": "# lru cache\n\nA cache object that deletes the least-recently-used items.\n\n## Usage:\n\n```javascript\nvar LRU = require(\"lru-cache\")\n , options = { max: 500\n , length: function (n) { return n * 2 }\n , dispose: function (key, n) { n.close() }\n , maxAge: 1000 * 60 * 60 }\n , cache = LRU(options)\n , otherCache = LRU(50) // sets just the max size\n\ncache.set(\"key\", \"value\")\ncache.get(\"key\") // \"value\"\n\ncache.reset() // empty the cache\n```\n\nIf you put more stuff in it, then items will fall out.\n\nIf you try to put an oversized thing in it, then it'll fall out right\naway.\n\n## Options\n\n* `max` The maximum size of the cache, checked by applying the length\n function to all values in the cache. Not setting this is kind of\n silly, since that's the whole purpose of this lib, but it defaults\n to `Infinity`.\n* `maxAge` Maximum age in ms. Items are not pro-actively pruned out\n as they age, but if you try to get an item that is too old, it'll\n drop it and return undefined instead of giving it to you.\n* `length` Function that is used to calculate the length of stored\n items. If you're storing strings or buffers, then you probably want\n to do something like `function(n){return n.length}`. The default is\n `function(n){return 1}`, which is fine if you want to store `n`\n like-sized things.\n* `dispose` Function that is called on items when they are dropped\n from the cache. This can be handy if you want to close file\n descriptors or do other cleanup tasks when items are no longer\n accessible. Called with `key, value`. It's called *before*\n actually removing the item from the internal cache, so if you want\n to immediately put it back in, you'll have to do that in a\n `nextTick` or `setTimeout` callback or it won't do anything.\n* `stale` By default, if you set a `maxAge`, it'll only actually pull\n stale items out of the cache when you `get(key)`. (That is, it's\n not pre-emptively doing a `setTimeout` or anything.) If you set\n `stale:true`, it'll return the stale value before deleting it. If\n you don't set this, then it'll return `undefined` when you try to\n get a stale entry, as if it had already been deleted.\n\n## API\n\n* `set(key, value)`\n* `get(key) => value`\n\n Both of these will update the \"recently used\"-ness of the key.\n They do what you think.\n\n* `peek(key)`\n\n Returns the key value (or `undefined` if not found) without\n updating the \"recently used\"-ness of the key.\n\n (If you find yourself using this a lot, you *might* be using the\n wrong sort of data structure, but there are some use cases where\n it's handy.)\n\n* `del(key)`\n\n Deletes a key out of the cache.\n\n* `reset()`\n\n Clear the cache entirely, throwing away all values.\n\n* `has(key)`\n\n Check if a key is in the cache, without updating the recent-ness\n or deleting it for being stale.\n\n* `forEach(function(value,key,cache), [thisp])`\n\n Just like `Array.prototype.forEach`. Iterates over all the keys\n in the cache, in order of recent-ness. (Ie, more recently used\n items are iterated over first.)\n\n* `keys()`\n\n Return an array of the keys in the cache.\n\n* `values()`\n\n Return an array of the values in the cache.\n", 26 | "readmeFilename": "README.md", 27 | "bugs": { 28 | "url": "https://github.com/isaacs/node-lru-cache/issues" 29 | }, 30 | "homepage": "https://github.com/isaacs/node-lru-cache", 31 | "_id": "lru-cache@2.5.0", 32 | "_from": "lru-cache@>=2.0.0 <3.0.0" 33 | } 34 | -------------------------------------------------------------------------------- /lib/system/busted/Settings.py: -------------------------------------------------------------------------------- 1 | # coding=utf8 2 | 3 | import sublime 4 | import sys 5 | import os 6 | 7 | from .Liste import get_root 8 | #from .Project import ProjectSettings, ProjectError, errorSetting 9 | from ..Utils import read_and_decode_json_file, read_file, get_any_ts_view, fn2l, get_any_view_with_root 10 | 11 | # ----------------------------------------- CONSTANT ---------------------------------------- # 12 | 13 | SUBLIME_PROJECT = 'sublime_project' 14 | SUBLIME_TS = 'sublime_ts' 15 | NO_PROJECT = 'no_project' 16 | 17 | 18 | # ----------------------------------------- SETTINGS ---------------------------------------- # 19 | class Settings(object): 20 | 21 | projects_type = {} 22 | 23 | 24 | def __init__(self): 25 | super(Settings, self).__init__() 26 | 27 | 28 | def get(self, token, root): 29 | return self.projects_type[root].get(get_any_view_with_root(root),token) 30 | 31 | 32 | def get_root(self, view): 33 | if view.file_name() == None: return 'no_ts' 34 | project_settings = view.settings().get('typescript') 35 | current_folder = os.path.dirname(view.file_name()) 36 | top_folder = self.get_top_folder(current_folder) 37 | top_folder_segments = top_folder.split(os.sep) 38 | has_project_settings = project_settings != None and hasattr(project_settings, 'get') 39 | 40 | # DO WE HAVE ROOT FILES DEFINED INSIDE THE PROJECT FILE 41 | if has_project_settings: 42 | roots = project_settings.get('roots') 43 | for root in roots: 44 | root_path = os.sep.join(top_folder_segments[:] + fn2l(root).split('/')) 45 | root_top_folder = self.get_top_folder(os.path.dirname(root_path)) 46 | if current_folder.lower().startswith(root_top_folder.lower()): 47 | if root_path not in self.projects_type: 48 | #TODOself.projects_type[root_path] = ProjectSettings(SUBLIME_PROJECT) 49 | pass 50 | return root_path 51 | 52 | # PROJECT SETTINGS BUT NO ROOTS INSIDE > DO WE HAVE A SUBLIMETS FILE ? 53 | segments = current_folder.split(os.sep) 54 | segments[0] = top_folder.split(os.sep)[0] 55 | length = len(segments) 56 | segment_range =reversed(range(0,length+1)) 57 | 58 | for index in segment_range: 59 | folder = os.sep.join(segments[:index]) 60 | config_file = os.path.join(folder,'.sublimets') 61 | config_data = read_and_decode_json_file(config_file) 62 | if config_data != None: 63 | root_path = os.path.join(folder,config_data['root']) 64 | data = read_file(root_path) 65 | if data != None: 66 | if root_path not in self.projects_type: 67 | #TODOself.projects_type[root_path] = ProjectSettings(SUBLIME_TS,config_file) 68 | pass 69 | return root_path 70 | 71 | #ProjectError(SUBLIME_TS,[config_data['root']+' is not a valid root file',config_file],config_file) 72 | return None 73 | 74 | #if errorSetting["ignore"]: 75 | # return None 76 | 77 | error_type = SUBLIME_PROJECT if has_project_settings else NO_PROJECT 78 | path = sublime.active_window().project_file_name() if has_project_settings else None 79 | message = ['No valid root file for this project inside your project file',path] if has_project_settings else ['You didn\'t create a project file, please create one:','Choose between the four possibilities bellow :'] 80 | #ProjectError(error_type,message,path) 81 | return None 82 | 83 | 84 | def get_top_folder(self,current_folder): 85 | top_folder = None 86 | open_folders = sublime.active_window().folders() 87 | for folder in open_folders: 88 | if current_folder.lower().startswith(folder.lower()): 89 | top_folder = folder 90 | break 91 | 92 | if top_folder != None: 93 | return top_folder 94 | 95 | return current_folder 96 | 97 | 98 | # ------------------------------------------- INIT ------------------------------------------- # 99 | 100 | SETTINGS = Settings() 101 | -------------------------------------------------------------------------------- /bin/node_modules/glob-expand/node_modules/glob/node_modules/graceful-fs/test/ulimit.js: -------------------------------------------------------------------------------- 1 | var test = require('tap').test 2 | 3 | // simulated ulimit 4 | // this is like graceful-fs, but in reverse 5 | var fs_ = require('fs') 6 | var fs = require('../graceful-fs.js') 7 | var files = fs.readdirSync(__dirname) 8 | 9 | // Ok, no more actual file reading! 10 | 11 | var fds = 0 12 | var nextFd = 60 13 | var limit = 8 14 | fs_.open = function (path, flags, mode, cb) { 15 | process.nextTick(function() { 16 | ++fds 17 | if (fds >= limit) { 18 | --fds 19 | var er = new Error('EMFILE Curses!') 20 | er.code = 'EMFILE' 21 | er.path = path 22 | return cb(er) 23 | } else { 24 | cb(null, nextFd++) 25 | } 26 | }) 27 | } 28 | 29 | fs_.openSync = function (path, flags, mode) { 30 | if (fds >= limit) { 31 | var er = new Error('EMFILE Curses!') 32 | er.code = 'EMFILE' 33 | er.path = path 34 | throw er 35 | } else { 36 | ++fds 37 | return nextFd++ 38 | } 39 | } 40 | 41 | fs_.close = function (fd, cb) { 42 | process.nextTick(function () { 43 | --fds 44 | cb() 45 | }) 46 | } 47 | 48 | fs_.closeSync = function (fd) { 49 | --fds 50 | } 51 | 52 | fs_.readdir = function (path, cb) { 53 | process.nextTick(function() { 54 | if (fds >= limit) { 55 | var er = new Error('EMFILE Curses!') 56 | er.code = 'EMFILE' 57 | er.path = path 58 | return cb(er) 59 | } else { 60 | ++fds 61 | process.nextTick(function () { 62 | --fds 63 | cb(null, [__filename, "some-other-file.js"]) 64 | }) 65 | } 66 | }) 67 | } 68 | 69 | fs_.readdirSync = function (path) { 70 | if (fds >= limit) { 71 | var er = new Error('EMFILE Curses!') 72 | er.code = 'EMFILE' 73 | er.path = path 74 | throw er 75 | } else { 76 | return [__filename, "some-other-file.js"] 77 | } 78 | } 79 | 80 | 81 | test('open emfile autoreduce', function (t) { 82 | fs.MIN_MAX_OPEN = 4 83 | t.equal(fs.MAX_OPEN, 1024) 84 | 85 | var max = 12 86 | for (var i = 0; i < max; i++) { 87 | fs.open(__filename, 'r', next(i)) 88 | } 89 | 90 | var phase = 0 91 | 92 | var expect = 93 | [ [ 0, 60, null, 1024, 4, 12, 1 ], 94 | [ 1, 61, null, 1024, 4, 12, 2 ], 95 | [ 2, 62, null, 1024, 4, 12, 3 ], 96 | [ 3, 63, null, 1024, 4, 12, 4 ], 97 | [ 4, 64, null, 1024, 4, 12, 5 ], 98 | [ 5, 65, null, 1024, 4, 12, 6 ], 99 | [ 6, 66, null, 1024, 4, 12, 7 ], 100 | [ 7, 67, null, 6, 4, 5, 1 ], 101 | [ 8, 68, null, 6, 4, 5, 2 ], 102 | [ 9, 69, null, 6, 4, 5, 3 ], 103 | [ 10, 70, null, 6, 4, 5, 4 ], 104 | [ 11, 71, null, 6, 4, 5, 5 ] ] 105 | 106 | var actual = [] 107 | 108 | function next (i) { return function (er, fd) { 109 | if (er) 110 | throw er 111 | actual.push([i, fd, er, fs.MAX_OPEN, fs.MIN_MAX_OPEN, fs._curOpen, fds]) 112 | 113 | if (i === max - 1) { 114 | t.same(actual, expect) 115 | t.ok(fs.MAX_OPEN < limit) 116 | t.end() 117 | } 118 | 119 | fs.close(fd) 120 | } } 121 | }) 122 | 123 | test('readdir emfile autoreduce', function (t) { 124 | fs.MAX_OPEN = 1024 125 | var max = 12 126 | for (var i = 0; i < max; i ++) { 127 | fs.readdir(__dirname, next(i)) 128 | } 129 | 130 | var expect = 131 | [ [0,[__filename,"some-other-file.js"],null,7,4,7,7], 132 | [1,[__filename,"some-other-file.js"],null,7,4,7,6], 133 | [2,[__filename,"some-other-file.js"],null,7,4,7,5], 134 | [3,[__filename,"some-other-file.js"],null,7,4,7,4], 135 | [4,[__filename,"some-other-file.js"],null,7,4,7,3], 136 | [5,[__filename,"some-other-file.js"],null,7,4,6,2], 137 | [6,[__filename,"some-other-file.js"],null,7,4,5,1], 138 | [7,[__filename,"some-other-file.js"],null,7,4,4,0], 139 | [8,[__filename,"some-other-file.js"],null,7,4,3,3], 140 | [9,[__filename,"some-other-file.js"],null,7,4,2,2], 141 | [10,[__filename,"some-other-file.js"],null,7,4,1,1], 142 | [11,[__filename,"some-other-file.js"],null,7,4,0,0] ] 143 | 144 | var actual = [] 145 | 146 | function next (i) { return function (er, files) { 147 | if (er) 148 | throw er 149 | var line = [i, files, er, fs.MAX_OPEN, fs.MIN_MAX_OPEN, fs._curOpen, fds ] 150 | actual.push(line) 151 | 152 | if (i === max - 1) { 153 | t.ok(fs.MAX_OPEN < limit) 154 | t.same(actual, expect) 155 | t.end() 156 | } 157 | } } 158 | }) 159 | --------------------------------------------------------------------------------