Open klesun opened 6 years ago
Completion should work here: (possibly because it is es6 export) 897369094ceae84286c0f4d73da9c1cd4c4221f7
Should make implicit depth limit configurable. Possibly raise it by default after testing. https://github.com/klesun/deep-js-completion/commit/4d9704c04971abaf60002afc24df7645ce4b7db7
When resolving private func passed to map/filter/etc...
as just var, rather than called in an arrow function, arg completion should still be inferred. https://github.com/klesun/deep-js-completion/commit/a8194dbcca1c3400e6c809528691db6e850e03bb
Completion from .d.ts
file hangs indefinitely, possibly circular reference. https://github.com/klesun/deep-js-completion/commit/4fab7c59cb086da2f6abd98af7dd4aa95fef98ee
Should fix irrelevant then
/catch
/finally
suggestions from vars infered from jsdoc. https://github.com/klesun/deep-js-completion/commit/c19db40632643d612d8b15bf43476e52a743d089
Completion should work here: (array shift()
not resolved, possibly related to https://github.com/klesun/deep-js-completion/commit/6ca0cee693a8a0f10a35bec0d1858bb8d73b3e37) 88db9dee7736a3610bb7464f23c9d7a617c78124
Require by name intention should require node modules without relative path: https://github.com/klesun/deep-js-completion/commit/6c56af41a067951126c25f0af43b9a5ad4306e56 Is: Should:
Should suggest: fareType
, gds
, pcc
, etc... here: (...
in function object argument, would be cool to even filter out itinerary
from suggested fields) https://github.com/klesun/deep-js-completion/commit/4621f2a274dd0141541e9339225f5a6514bbe5f7
Completion is rather slow here: (it would be faster to type the key myself than wait these 1.26 seconds, and it feels more like 2 seconds) f8dc39d58ef18f1b8d542a7e14b38e2f03e5bac0
Should also suggest: 'pcc', 'recordLocator', etc... here 58dcbeb
Completion should work here: (generic type passed to dts interface) a0d202f
Completion should work here: (lodash map - should support generics in the definition) 6cf404d918e27f925a35b07ed20c11bad2c38ce5
Completion should work here: (Array.every()
arg) 6e9c6857f582bfa50988b0a492965c57fae5bf01
Completion should work here: (onDemand()
wrapper func) 7fc9b622558ab203e2a627592134b7221026b7e7
Instead of *|*|*
show the PSI associated with the property in the value preview. For a
in {a: dStuff()}
it should be doStuff()
, for b
in obj.b = doOtherStuff()
it should be doOtherStuff()
, for c
in static c(arg) {}
it should be (arg) => {}
and so on... 52d51073bccf9c32ec96c18325720ea19f7cbf9e
Completion should work here (suggest: cmd, output, type, etc...) (failing test case demonstrating the cause of the issue: 1a89334b69c98d298456055e559b849533234001) fixed in 03a1a342df5d28911f9ecbe1f667b2cb7ac1e17e
Should implement somehow when you click Alt + Enter on an undeclared variable, if it matches some file name, that it would suggest adding require
statement with the path to this module (if the file is a CJS module). 8b757b823d9db23aa86401802003f54c50efb788
Should not suggest fields returned in an async
function, as it actually returns a Promise
: 0a8cff1146202911594e68d2f47b0e6080459833
Another relevant example:
no completion of segment fields here - should fix. 7e33808ae72c6031447d3dcf80907db3a7f9e235
Completion should work here: 7e33808ae72c6031447d3dcf80907db3a7f9e235
Completion should work here: https://github.com/klesun/deep-js-completion/commit/b998e2b2dd337ba8d5e328f03de92c667bfd0653
Coompletion should work from npm module index file exports.someField = ...
. (defined in main
field of package.json
) https://github.com/klesun/deep-js-completion/commit/b5b68a42350c90b61763210789b4be5372379e3f
Completion should work here: https://github.com/klesun/deep-js-completion/commit/b5b68a42350c90b61763210789b4be5372379e3f
Wrong suggestion: pricingPart
(I suspect assignment resolution treats processed.pricingPart.parsed.pricingList[0]
as assignment destination)
51f2700655c2dfb0297dfc85453688a3f8d86254
Completion should work here (probably plugin does not look for private func usages because it's a class) 63d9e571f287f6e78293d35d23c10afb50812eb8
Completion should work here: 75dabd07c457b244f4ee06963a208000d8a57f1d
Object
class properties should not be suggested here, and it should not hang for several seconds, and cmd
/type
/data
should be suggested: 8ac6a3c84259b5bea8aab2bcd4da0941871913f3
- something conflicts with something. If you remove TRAVELPORT
and AMADEUS
, you get completion in SABRE
, otherwise you only get completion in TRAVELPORT
. 45d5eba28a53ddf98c423fa8faf6a7588f2754e8
When async
function returns a promise, you have to type await
twice in order to reference the wrapped value: . It should work with just one await
. ba264fead4cd1ff44ecd2ea5a2e8959e01db8b70
Completion and GoTo still take many seconds in some places (Component.observe()
in CMS). bb5924738ff7daf980850692c3332c30ea599728
Complete property names in @param a = require('SomeModule.js').someField
589bae3e2bda91d2946c8e0e11bbc28ce16a700f
Upd.: damn webstorm does not show completion in the doc when caret follows a (
, a "
or '
. Should investigate and look for workarounds like making text followed by an =
a code injection.
Complete file name in @param a = at('SomeFile.js')
and require('SomeFile.js')
(probably should put files from current directory and it's sub-directories first, the from it's parent, then from it's parent, etc... so that stuff like node_modules
was at the very end (maybe even exclude it altogether)) 3a0ccf5ab9c854c0fdd25ae15c9b4c05c8b830c3
Support Promise.all
ac2098631e5f03d293085a61949a6293d048627d
Should resolve the d.ts type definitions even without the help of the built-in typing so that Ctrl + B on properties defined there worked. 55ce9220e8514b750e376600abf4111fe9b90158
Should eventually return resolved types in an iterator same way as in the php plugin, since there are already some places that take something near a second to complete. See https://github.com/klesun/deep-assoc-completion/issues/47 3c8dfb7014cb516843f7a60cacf3df6275fd8eee
Completion sometimes takes 4 seconds - it should not. Another example: Should at least, if resolution takes more than, let's say 0.2 s, show built-in completions before proceeding with the resolution. Some investigation and optimisation would be nice too, maybe this is already time to move to iterators... 3c8dfb7014cb516843f7a60cacf3df6275fd8eee
Completion should work here: (the issue is possibly that this
is used inside, and we ignore built-in type of member access) c09772ed3582bfc9c49d8aeab8fd3ab3183f80dc
Should support new
and class methods. VERY NEEDED. Probably related to the issue below. 55ce9220e8514b750e376600abf4111fe9b90158
Allow to specify =
type in @member
, @type
, @var
, etc... jsdoc-s, not just @param
0377be66f8b9dd3d492105a74b1919825ca95da2
Completion should work here: - should have suggested: id
, logId
, createdMs
, context
, sessionData
. Possibly it does not work because Promise.all()
does not get resolved completely. ac2098631e5f03d293085a61949a6293d048627d
Prototype object properties should not show in the top of the list: This happens because I use built-in type resolution here from d.ts
file, which probably lists inherited properties before own properties... a3447b83275351b3e0be80479557bd7f29bc197b
Add for (let [k, v] of Object.entries(obj))
support (and any other function obviously). 5e997ed34c9641148030a5dd6747acf49f4c482a
Invent the doc format that would allow referencing unexposed functions in other files. Something like /** @param segment = {date: in('/app/parsers/common.js').parseDate()} */
.
Or maybe from('/app/parsers/common.js').in('init').in('makeDefaultParams').var('fareTypeCodes')
0aa883bc5c0d191d0726933ca08ee2715b6a0493
Support tuple destructuring assignment and args. 6153271170b14a8e0d185048893e9b62250730eb
Gosh, I really want to stop using the method resolution by built-in resolver: - it gives you any function named that way ignoring the object type altogether. Maybe there is a parameter at least to tell it not to fallback to anything somewhere? Actually, can make things simpler - do not use built in resolution when it's a reference expression with a qualifier (we'll still use built-in to resolve the qualifier anyway, so no useful type info will be lost). 6ef91dd2a2bf041d0ee74e8d87849766a6afecd8
It would be nice if completion worked here: (just the name of file without path in require
and a property on it is accessed and invoked) https://github.com/klesun/deep-js-completion/commit/71700cbdb6c80aba2bd6c540d39518400fbb0ff6
A bug: (completion should not be suggested on a var name - it should be only property name (l guess this happens because both property access and var access are a JSReferenceExpression
))
Another one:
79c4e3e733ef9960669f788ed67d7a584d6f9749
A bug: Promise.resolve(A).then(A => B)
gets resolved as Promise<A>
if B
is an empty object.
82f337f2fddefe572f3bf621da40e77fae76e7d4
IMPORTANT: infer type of rq
and rs
in:
let app = express();
app.use((rq, rs, next) => {});
app.get('/some/route', (rq, rs) => {});
app.post('/some/route', (rq, rs) => {});
24dccfd97bc2c4d57a4a69fae12abb003406cba0
Should infer element type from for
loop:
Suggested keys should be: key
, value
, enabled
(the key
is probably suggested because it is referenced in an assignment, what is wrong by the way). c0dbf2f54cc559b94863fecbd7adc66685bbfe50
Wrong completion:
It should be id
and stuff. 6830febbc8407d34f40e8659d2b04e4060f45d83
In [].reduce((sum, next) => sum..., [])
; sum
must have completion of the lambda return type, not the same completion as next
.
Completion should work here: 42abf5ea54d74abd211e719c743aa5887932287e
Completion from property access currently suggests stuff as if accessed property name was undefined:
The then
is taken from Dom.showMessageDialog
, the s
, trigger
and with
are taken from Dom.wrap
. Rest is already suggested by IDEA. Should fix. Probably caused by some IDEA string
index types without actual string value being mixed with deep types. bf10eff1426cb46259621cdab16e3ecd3809edf9
And generally, plugin should be disabled when inside a typescrypt file: there is nothing to improve there.
Go To Definition. IDEA navigates you to all properties with same name in the project. Would be good to at least put correct (read "mine") options first. 8f1337540e53940921807a8a4419233a27f2338e (Upd.: looks like idea does not suggest anything with same name when I provide at least one GoTo option)
Doc completion like @param denis = Denis()
does not work with top-level vars, it only works if var is defined in the scope of a function. 56be76f7b1940539eec3689b41323765bd9869fd
Apply some optimisation. Currently getting completion in GdsSessionController.runInputCmd
result takes 1.614... seconds, most likely because of how reference search in VarRes
is implemented (scanning whole file each time). 13cf3e1b776f2331daa297f9840ec969aacd5460
Add inference on function arg based on what is passed to this function. 64f5cd391e1e52b954e1c654fd8ad2b013e4e1ed 97942e481a6d66b70832f8638743a703a73a1f5d
Resolve new Promise((resolve) => ... resolve(value) ...)
. 19a05e4c61765e248b6bf166ea96421bd6a3db84
Infer array type from push and index assignment: https://github.com/klesun/deep-js-completion/commit/57a801b4f108905e3967cbc272c9c8258e425aa5
let flatTracks = [];
flatTracks.push({trackNum: i, chan: ownChan, events: ownEvents});
flatTracks[i] = {trackNum: i, chan: ownChan, events: ownEvents};
flatTracks.map(a => a.); // should suggest [trackNum, chan, events]
Completion from promises VERY NEEDED 47fd2b3
Go To key key definition when Ctrl + B on a key in let {range, opt} = lib;
0269932488c526358dcfc9694a8cdd4d27dd87b1
Support let {range, opt} = lib;
assignment 7449f037618fbdf6a2efe13e8582548a5f8f1c3c
Infer type of modules required like this: c811edbaa5d6bac11964feaf55b621fab9df963a
var klesun = Klesun();
klesun.requires('./Tls.js').then = (Tls) =>
klesun.requires('./MidiUtil.js').then = (MidiUtil ) =>
klesun.whenLoaded = () => {
let {range, mkDom, opt, promise, deepCopy} = Tls();
let {ticksToMillis, isNoteOn, isNoteOff} = MidiUtil();
let $$ = (s, root) => [...(root || document).querySelectorAll(s)];
Infer type of binary expression arrow function: 5465738e6256e4fb9d3862b3ac4a929c0b5990a5
let collectParams = () => 1 && {
ticksToTempo: dict($$(':scope > *', tempoList).map(block => [
+$$('input.start-at', block)[0].value,
+$$('input.tempo', block)[0].value,
])),
tempo: tempoInput.style.display !== 'none' ? tempoInput.value : null,
scaleRegions: $$(':scope > *', regionListCont).map(collectRegion),
sentences: $$(':scope > *', sentenceListCont).map(collectSentence),
configTracks: $$(':scope > tr.real', trackList).map((t,i) => 1 && {
trackNum: i,
instrument: opt($$('select.instrument', t)[0]).map(sel => sel.value || null),
velocityFactor: $$('.holder.original-volume', t)[0].innerHTML <= 0 ? 1 :
$$('input.track-volume', t)[0].value /
$$('.holder.original-volume', t)[0].innerHTML,
}),
};
collectParams().; // should suggest [ticksToTempo, tempo, scaleRegions, sentences, configTracks]
~~Add inference in map
, forEach
, filter
, etc...~ cadcb8e9feb493e9ea6cd8297e4f58871bbdba92
When Only type-based completion in settings is set, behave as is - add completions only if no such option from built-in completion. If the flag is not set however, built-in suggestions should be skipped instead if got same prop name, and plugin completions should be in the top of the list. 3c157801aca25e0a100c1ba50c146563b2848a5d
Completion does not work in phpstorm for some reason. Should investigate: a7593d6ae0f9641692eb254a9083200608795b26
Would be nice to have completion and refactoring here: (like php does) ba569ba08171b907a6d4ab423e897184727003f8
Great list. Let me know if you need a testing job!
Got it. Your reports are a great help, thanks a lot!
Normal Priority
Should stop suggesting the var name from the following line as a key:
Should provide property name completion in object destructuring assignment.
Should allow using different operation in local var jsdoc, like taking an element from array, not just calling it.
Should support typescript
ReturnType<>
flatMap
afterflatMap
- arg type not inferedShould not suggest private class fields in typescript
When completing keys with special characters (like space) or numbers, should make it
obj['some Key']
insteadobj.Some Key
. (webstorm does that for typescript keys)Completion should work here: (
flatMap()
result;store.pricingBlockList[0]...
does not seem to provide completion either, even thoughstore.pricingBlockList.map(a => a)...
does)Completion should work here: (result of function passed to a functiion)
Make it possible to specify some directories to distinct modules with same names in jsdoc:
Support and complete lodash get keys. Should suggest:
bookingClass
,segmentNumber
here and here as wellCompletion should work here: (lodash groupBy)
Completion should work here: (again lodash map)
Would be cool to be able to go to string by value in
===
expression like in php plugin.It would be nice if current scope var completion worked as well, example:
@param gdsData = parseCmdRs()
GoTo require() in the docs, pls
GoTo does not work here even though completion does:
Complete var names in
@param a = at('SomeFile.js').someVar
Make
@param a = at('File.js').varName
support vars defined inside methods and anonymous functions (it currently only goes inside functions defined likevar someVar = () => {...}
).Also, please, excluderequire()
vars from completion options.Completion still takes 800 ms even though there were just 300 expressions. I suspect that major part of CPU is spent on stuff like
VarRes::findVarUsages
. Should optimize it somehow if this is the case. I also have suspicion aboutJSScopeNamesCache.getOrCreateNamesForScope
... Upd.: 300 ms gets taken byVarRes::findVarUsages
. Could optimize that with reference search or some kind of caching like a hashmap per file or psi with var name as key.When both this plugin and deep-assoc-completion are loaded, make
/** @var hotel = DataFormats::getHotelById() */
provide completion using the type resolution from the other plugin.Private func completion should work when you pass this function to
.map(someFunc)
,.filter(someFunc)
, etc... by reference instead of directly calling it with.map(a => someFunc(a))
.Make it possible to specify return type as well in the docs like this:
/** @return {Promise} makeSessionRecord() */
Replace hardcoded
map
,reduce
,then
, etc... completion logic with generics from built-ind.ts
files.Go To express route on Ctrl + B at string literal matching the route. Take that routes are defined in
server.js
orWebRoutes.js
.String value
===
completion.Add inference from
promise-sql
SELECT * FROM {$tableName}
It would be nice to have path completion in the doc. Especially cool would be that when you type
@param db = from('Db.es6')
you got'./backend/Utils/Db.es6'
completion from all files with such name. Actually, this completion would be useful when you type realrequire('')
as wellIt would be handy, if in node project instead of
import Db from "../Db.es6";
auto-import addedconst Db = require('../Db.es6');
. Just an action that would convert them will be fine too.Low Priority
When completing a method, should add parentheses in the end, since it's more often that you want to call a method, than to pass it somewhere.
When choosing what module to use in "Require by var name" intention - put
@deprecated
ones in the bottom of the list.Guessed built-in completion options still corrupt the deep completion:
I have a genius idea - when you Ctrl + B on a AMD
define()
module in func args, GoTo the path it corresponds to:Or maybe it's even possible to highlight them as references with Refernce Provider?
Should infer
this.field
type (Upd.: this would be rather troublesome since IDEA does not provide API to resolve allthis
usages in a class. Also, the completion would work here if you explicitly declaredstate
as a cass field above the constructor)