jbaron / cats Goto Github PK
View Code? Open in Web Editor NEWCode Assistant for TypeScript
License: Apache License 2.0
Code Assistant for TypeScript
License: Apache License 2.0
Add support for version control, at least git.
I'd like to help improve cats, and I have questions. Yet I can't find anyplace to discuss with the authors. Please make a cats-dev mailing list on google-groups or some similar service!
It would be useful for api discovery to be able to display matching symbols ignoring case sensitivity and searching anywhere in the symbol.
For example, if someone was looking for HTMLCanvasElement
class and that person might have forgotten what it is called, just typing canvas
and ctrl+space would not show HTMLCanvasElement
. Allowing to search without case sensitivity and anywhere in the symbol would allow HTMLCanvasElement
by just typing canvas
.
When creating a new file (via File -> New File) in an open project and saving it, the file seems to get saved in the cats
root folder, rather than in the project's root folder. Tooks me some searching to figure out where the file went ;-)
When the main browser windows re-sizes, the editor pane doesn't re-size automatically. Have to check how to inform the ACE editor to re-size itself to the full available area.
I've run into a couple of odd problems when opening and closing projects.
Currently, the "Close Project" command in the "Project" menu does nothing the first time you click it - and the second time, an exception is thrown.
Opening another project works - however, if you close the first project after opening a second project, the entire application (both projects) close.
Let the end user select a piece of TypeScript code than will than be formatted.
Rename a type (method, property, class, interface, ...) and automatically update all references to this type.
I created this typings to ace editor https://github.com/borisyankov/DefinitelyTyped/tree/master/ace. What do you think about use this definition in your project?
I'm running into something very strange when I save - sometimes a line or a small change somewhere does not get saved.
I just pulled the latest updates, including the updated version of Ace, and this problem started before that update.
It's not 100% consistently reproducible, and I'm not able to precisely pinpoint what triggers it - it seems to be dependent on timing, so bear with me, you may have to try this a few times to reproduce it.
Try something simple, like this:
console.log('foo');
console.log('bar');
With "build on save" enabled, press CTRL+S and open the generated file - the generated JS should be largely identical to the JS, but now go back to the first line and change it, so your file looks like:
console.log('foo', 'baz');
console.log('bar');
Immediately after making the change, press CTRL+S, and then look at the generated file - it likely still reads 'foo'
rather than 'foo', 'baz'
in the first line??
Sometimes this can really trip you up - I've spent quite some time chasing "phantom bugs" already, because often, making another change, or undoing and hitting save, just saves the previous version of your code.
In a few cases, I have even had lines of code that were not saved to the output file at all, or lines of code that I had deleted which were still being saved. For two nights I have been chasing this one bug in my tree control, and finally I started poking through the generated source code and noticed one line was not being saved at all. (I keep my IDE running for days, hibernating my system instead of shutting down.)
Closing the IDE entirely and starting fresh usually brings things back to normal.
I wonder if there is some command you need to issue to ACE or something, prior to save, to make sure the state of the document reflects what's on screen?
Support source and output directories to provide greater flexibility when compiling TypeScript source code.
I posted a tiny sample project here to demonstrate this issue - I suggest you clone it locally and open it as a project.
Initially, when I open the "bar.js" file, I get a warning about foo
being undefined.
Placing the cursor at the beginning of the document and pressing ENTER (inserting a blank line before the /// <reference
tag) causes the error to disappear.
Subsequently, deleting the reference tag does not bring back the error message.
Doing all sorts of editing like copy/paste/undo/redo sometimes triggers an update, but most of the time, it does not - it seems really difficult to get the editor to notice that these changes are being made to the source code at all...
Right it is not possible to navigate to declarations in lib.d.ts due to the fact that this file is not part of the project.
The console tab does not behave (and was not implemented) like the other two tabs at the bottom of the UI ("Problems" and "Search") - it doesn't scroll.
It probably also ought to auto-scroll to the bottom - currently, it overflows after saving/building a few times, and you can't see the status of the last build anymore.
After closing the active tab, no tab is active and the area under the tabs is empty - you have to click on another tab to bring back the editor.
When closing the active tab, the previous tab should automatically be activated.
The Outline panel only displays the modules and classes (etc.) in the currently active tab.
I don't think this is how a traditional outline in an IDE works?
Normally it's per project, rather than per file - so you can get a complete over of all the components (modules and classes etc.) in a single view, rather than having this view switch as you tab through files.
Should provide documentation (perhaps also video) on how to use CATS. Topics that are not self explanatory:
Extract an interface from a class and store it as part of a declaration file.
Don't use JQuery when there are pure DOM API alternatives available. This should improve performance and reduce dependencies.
Improve FileTree component, to include:
Copy/Paste from menu doesn't work. The keyboard shortcuts work fine.
Reason is that there isn't an editor command for it. Seems Ace editor uses the native OS solution for copy/paste and not a special ACE command. So need to investigate how to do this from the menu.
Hi Peter,
I cannot contact you. Your website doesn't work and you don't have a public email address in github.
I would like to ask you for some task where I could help you with this project (maybe something simple to start with).
Best regards,
David
PS Sorry for this "pseudo" issue
Based on a type, generate some code that on run-time can validate an object against this type.
Put all the IO related stuff in a special module, so it could be easily replaced with other implementation.
This would make it possible for example to use a server-side components instead of Node within the WebKit environment.
Do you provide in the future JSDOC support, like MS does for Visual Studio.
Just reading the code, I wonder if you mean this code in isense.ts...
// Case insensitive sorting
function caseInsensitiveSort(a: { name: string; }, b: { name: string; }) {
if (a.name.toLowerCase() < b.name.toLowerCase()) return -1;
if (a.name.toLowerCase() > b.name.toLowerCase()) return 1;
return 0;
}
To be more like this..
// Case insensitive sorting
function caseInsensitiveSort(a: { name: string; }, b: { name: string; }) {
if (a.name.toLowerCase() < b.name.toLowerCase()) return -1;
if (a.name.toLowerCase() > b.name.toLowerCase()) return 1;
// the lower-case strings are equal, so now put them in local order..
if (a.name < b.name) return -1;
if (a.name > b.name) return 1;
return 0;
}
This code will cause strings which different only in case to be adjacent to eachother, but in a deterministic way without collisions.
Implement template system to quick-start a new project. For example templates for:
Will help newcomers to be more quickly productive. Could also include some sample projects.
Theme handling should be done by using some css rules and update these rules, not by setting css style properties on individual elements.
Is it possible to generate sourcemaps from CATS?
That is a very important feature for debugging the code.
Praise: good work for creating CATS, looks cool and has most of the good refactoring/navigation features ๐
Is the "Problems" tab supposed to populate with a list of all errors/warnings?
I don't see anything in this tab, while editing or after compiling.
Fantastic work, by the way! Best thing I have found for TypeScript so far :-)
Invest in reusing existing UI framework or improve own code base. Things to look for:
I create an empty directory and start cats on it.
If I press project->properties the ide "does nothing" and I got error message in console:
Caught exception: Error: ENOENT, no such file or directory 'c:\develop\jeka\helloworld\node_files_watch.settings\config.json'
If I create empty config.json manually it opens well with default values.
In previous version automatic creation of config.json did worked.
When switching between tabs, the Outline panel loses it's state - all of the tree nodes collapse down to the root, and have to be expanded again.
Sometimes opening a new project fails and no new browser window is shown. Seems to only happen when same project is opened again. A different project opens fine.
Add declaration file for Node-Webkit native API to improve type checking.
Add minify and mangle support for the generated JavaScript files
I try do delete file from Files tree (rmb->Delete)....
Filename still exists in Files tree. (file is actually deleted, but it is invisible)
I try to delete it from Files tree second time....
IDE crashes:
Uncaught node.js Error
Error: ENOENT, no such file or directory 'C:\develop\jeka\helloworld\cats\samples\greeter\greeter.js.map'
at Object.fs.statSync (fs.js:524:18)
at Object.remove (file:///C:/develop/jeka/helloworld/cats/lib/main.js:12:29)
at MenuItem.deleteFile as click
at MenuItem.handleEvent (menuitem.js:167:12)
at IDWeakMap.global.__nwObjectsRegistry.handleEvent (node.js:496:26)
More compiler options should be configurable and passed to compiler to allow greater flexibility when compiling TypeScript to JavaScript
Enable true debugging from within the IDE (and not only using the WebKit developers tools). This would require more integration of WebKit/V8 and CATS.
Seems that on Windows the outputOption compiler configuration parameter doesn't work correctly. Somehow TypeScript doesn't rewrite the output files correctly. Example:
d:/ts/cats/tmp/d:\ts\cats\src\cats\acesession.js
outputOption was set to "d:/ts/cats/tmp"
Perhaps all file names need to have forward slashes (Unix style) before sending to TypeScript worker.
Navigate to the code where a type is defined. Should be available through the context menu.
With a large set of possible completions, scrolling in the current popup becomes slow. A different approach is needed for building the popup window.
It seems there's a problem with type-reporting when using generics in interfaces:
interface Handler<Event> { (event: Event) : void }
interface LoginEvent { username: string }
var handler: Handler<LoginEvent>;
In the TypeScript Playground, if I hover over the handler
variable, the reported type is Handler<LoginEvent>
, as defined - but if I hover over the same variable in CATS, the reported type is simply Handler
.
Maybe the TypeScript engine needs an update?
Screen coordinates calculation when the horizontal scroll-bar is used seems to be of causing the wrong tool tip information to appear.
Tabbar should more look like tabs to improve user experience.
Implement a find & replace that can search the all the files within the project or within a folder.
(updated based on feedback from maryo)
Right now when a TypeScript file is updated in the editor, the whole content is send to the worker to check for possible issues. This forces the compiler to refresh a large part of he AST.
Compiler has support for incremental updates that should improve performance and reduce CPU load.
src\cats\commands\projectcommands.ts, line 75:
if (name.charAt(0) !== PATH.sep) {
name = PATH.join(project.projectDir, name);
}
Thats fine for unix but in windows I get "C:\foo\C:\foo\bar.js"
Should be something like
if (name.charAt(0) !== PATH.sep && name.charAt(1) !== ':' ) {
Could you point me to some pretty guide about pull requests in github?
I like to keep the compiled JS file open to review it after compiling.
Currently, files that get updated on disk while open, do not automatically reload/refresh - it would be nice to have an option to auto-refresh open files on change.
If the underlying framework does not provide a way to monitor files for changes, perhaps files could be polled for changes periodically, and/or when you switch tabs?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.