GithubHelp home page GithubHelp logo

simonvizzini / vscode-factorio-lua-api-autocomplete Goto Github PK

View Code? Open in Web Editor NEW
25.0 3.0 19.0 2.37 MB

VS Code extension that provides autocompletion for the Factorio API

License: MIT License

TypeScript 100.00%
factorio vscode-extension lua

vscode-factorio-lua-api-autocomplete's Introduction

Factorio API autocomplete extension

Features

  • Autocomplete of all Lua classes and globals

    autocomplete

  • Mouse hover tooltips, with links to the official documentation at http://lua-api.factorio.com

    tooltips

Dev Requirements

Using nvm you can get the correct node version to run the scraper: nvm use.

After this install the necessary modules with npm install.

Update data

Run the scrapper to pull the latest data from the Factorio API documentation: npx ts-node scraper/index.ts

Todo

Features

  • Better support for functions that take tables as argument
  • Function signature hints (registerSignatureHelpProvider)

Technical tasks

  • Instead of storing inherited properties in the data file, they should maybe get looked up during runtime
  • Unit tests

vscode-factorio-lua-api-autocomplete's People

Contributors

roang-zero1 avatar simonvizzini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vscode-factorio-lua-api-autocomplete's Issues

Stuck on "loading..."

Just tried this extension in most recent version of VSCode (1.12.1) and when I press ctrl+space it just says "loading..." with nothing else.

Also is this updated for 0.15 yet?

Great work on this by the way, it's a really nice idea! 👍

[feature] typescript typings support

problem

i'm interested in using TypeScriptToLua with this, but it's not a supported feature

discussion

perhaps you could serve both customers by perhaps making the src a declaration file and generating the json auto-completions? or, perhaps, a DefinitelyTyped package could be created, and this package could pull that in and generate the artifacts here from it? if you're not interested, that's ok too :) . im just a bit over lua and want that TS goodness, thus am looking into it!

Missing documentation on Serpent

serpent, the library Factorio provides for printing tables to strings, does not seem to be recognized by this extension — there is no documentation.

Issues setting up dev env and running scraper

Hi I was interested in using this extension to write a factorio mod. I noticed the definitions were out of date and wanted update them.

I have attempted this on both windows, windows wsl, and mac os x.

I cloned the repository, selected the correct node version using nvm use and then ran into some issues during npm install

Here is log from my terminal

Zacks-MBP:vscode-factorio-lua-api-autocomplete zack$ npm install

> [email protected] install /Users/zack/projects/vscode-factorio-lua-api-autocomplete/node_modules/libxmljs
> node-pre-gyp install --fallback-to-build --loglevel http

node-pre-gyp WARN Using request for node-pre-gyp https download
node-pre-gyp http GET https://github.com/libxmljs/libxmljs/releases/download/v0.19.5/node-v57-darwin-x64.tar.gz
node-pre-gyp http 200 https://github.com/libxmljs/libxmljs/releases/download/v0.19.5/node-v57-darwin-x64.tar.gz
[libxmljs] Success: "/Users/zack/projects/vscode-factorio-lua-api-autocomplete/node_modules/libxmljs/build/Release/xmljs.node" is installed via remote

> [email protected] postinstall /Users/zack/projects/vscode-factorio-lua-api-autocomplete
> node ./node_modules/vscode/bin/install

Detected VS Code engine version: ^1.20.0
Error installing vscode.d.ts: Error: Request returned status code: 404
Details: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /api/releases/stable</pre>
</body>
</html>

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node ./node_modules/vscode/bin/install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/zack/.npm/_logs/2021-04-19T00_38_16_407Z-debug.log

Without resolving this error, trying to run the scraper hits a typescript error

Zacks-MBP:vscode-factorio-lua-api-autocomplete zack$ npx ts-node scraper/index.ts
⨯ Unable to compile TypeScript:
scraper/classes.ts:15:18 - error TS2304: Cannot find name 'FactorioTypeMap'.

15     let classes: FactorioTypeMap = {}
                    ~~~~~~~~~~~~~~~
scraper/classes.ts:127:55 - error TS2304: Cannot find name 'FactorioType'.

127                     _.forEach(type.properties, (prop: FactorioType) => {
                                                          ~~~~~~~~~~~~

I would appreciate any guidance to getting this issues resolved so I can update the definitions and potentially improve the extension in other ways. Thanks.

Update?

There is are machine-readable format for the factorio api.
Could your extensions use this? It should be easier than to scrap the html documentation.

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

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

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.