saltudelft / type4py-vscode-ext Goto Github PK
View Code? Open in Web Editor NEWVSCode Extension of Type4Py
License: MIT License
VSCode Extension of Type4Py
License: MIT License
For the file workers.py
from here, when performing type completion at line 46 for the variable results_list
, the following exception occurs:
Exception has occurred: TypeError: Cannot read property 'forEach' of undefined
t ParamHintCompletionProvider.<anonymous> (/Users/amir/projects/type4py-vscode-ext/dist/extension.js:250:99)
at Generator.next (<anonymous>)
at /Users/amir/projects/type4py-vscode-ext/dist/extension.js:212:71
at new Promise (<anonymous>)
at /Users/amir/projects/type4py-vscode-ext/dist/extension.js:208:12
at ParamHintCompletionProvider.provideCompletionItems (/Users/amir/projects/type4py-vscode-ext/dist/extension.js:235:16)
at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:84:171333
at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:64:11884
at new Promise (<anonymous>)
at Object.g [as asPromise] (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:64:11856)
at F.provideCompletionItems (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:84:171304)
at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:84:190970
at ze._withAdapter (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:84:181033)
at ze.$provideCompletionItems (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:84:190946)
at d._doInvokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:88:12815)
at d._invokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:88:12507)
at d._receiveRequest (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:88:11108)
at d._receiveOneMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:88:9960)
at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:88:8064
at l.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:57:1835)
at E.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65:15634)
at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:103:29816
at l.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:57:1835)
at E.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65:15634)
at t._receiveMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65:20892)
at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65:17778
at l.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:57:1835)
at c.acceptChunk (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65:12995)
at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:65:12343
at Socket.b (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:103:13287)
at Socket.emit (events.js:315:20)
at addChunk (internal/streams/readable.js:309:12)
at readableAddChunk (internal/streams/readable.js:284:9)
at Socket.push (internal/streams/readable.js:223:10)
at Pipe.onStreamRead (internal/stream_base_commons.js:188:23)
at Pipe.callbackTrampoline (internal/async_hooks.js:131:14)
Currently, the extension does not show predictions for self
attributes in a class. Consider the following example:
class Foo:
def __init__(self, name):
self.name = name
In this example, the predictions for self.name
are not shown, though it exists in the JSON response from the server. Also. line number info is available for self attributes in the JSON output.
The extension should be supported by unit and integration tests.
In the explorer, the infer
command can be added to the context menu when right-clicking on source files. It infers type annotations for the chosen file.
Inference command should be auto-invoked when using the Type4Py extension. Some possibilities:
Very recently, I've released Type4Py's Docker image which contains both a local model and a web server. Given this, a new setting should be added to the extension to allow users to utilize the local model without relying on our central server.
In the future, the following edge cases should be handled. In the prototype stage of the extension, they are rare occurrences and are not highly relevant.
typestore
data should react to the event accordingly by updating the cacheIn general, a mechanism will have to be devised on how the file cache will react when a file is changed. Should some annotations be invalidated, or the Type4Py server call re-triggered? (this should go into it's own issue later on, as it might require changes to the model, server and the client)
Additionally, the line numbers may be invalidated, rendering the cache incorrect (e.g. if all functions shift by 2-3 lines)
When using :
and ->
for annotations, adding a space character results in it being treated like a literal character, and thus removing predictions like int
, but not predictions that have a space character (e.g. Union[float, int]
.
The issue should be looked into to see if the space characters can be ignored.
UX should be improved by auto-dismissing info messages that pop-up after running the type inference command
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.