Comments (19)
Found a way, although this might not relate to this project whatsoever.
Just type in below in terminal/cmd
npm install @types/screeps
npm install @types/lodash
Credit to:
Remoh(ID: UJL4HDL9Z) on Screeps Slack
from screepsautocomplete.
Add the line at the beginning:
/// <reference path="where/ever/ScreepsAutocomplete/is" />
and you are done -_- took me 3 days to find that...
Result is that I have now a entire tool chain working that I never wanted ... <- which worked before i got autocomplete to do something.
Code is awesome but wired in some ways I blame MS ;-P
from screepsautocomplete.
This is for some reason very buggy so I recommend putting it in every file, if you still have issues I recommend to switch to a typescript definition like screeps.d.ts sometimes it works without reference link sometimes not.
I still have no clue what's going on so I just tell you what "somehow" worked for me ^^
from screepsautocomplete.
Just in case someone happens upon this problem . Add _references.js to the ScreepsAutocomplete folder and VScode's intelisense works.
Also add jsconfig.json with the following to the root folder if your project:
{ "compilerOptions": { "target": "ES6" }, "exclude": [ "node_modules" ] }
from screepsautocomplete.
For future googlers, I was just able to get this working with a combination of MrFaul and quonic's advice. I added the _references.js file to the ScreepsAutocomplete folder as quonic suggested, and then added
/// <reference path="..\..\ScreepsAutocomplete\_references.js" />
to the tops of the file, not just a reference to the folder of the project. This worked without me needing to add a jsconfig file, at least I haven't yet.
from screepsautocomplete.
I got it working here summary:
-
Add ScreepsAutocomplete-master to screeps/scripts/screeps.com/default
-
Added ScreepsAutocomplete to main Screeps folder (in .../steamapps/common for me)
-
Added _references.js to ScreepsAutocomplete folder
-
Added jsconfig.json to ScreepsAutocomplete folder this is the file with in it:
{ "compilerOptions": { "target": "ES6" }, "exclude": [ "node_modules" ] } -
Opened a terminal from VSCode and did these two:
npm install @types/screeps
npm install @types/lodash -
Restarted VSCode and it works.
Some of these steps are not needed but it works. Just the summary, thanks to the guys above!! I've been trying to get this to work for quite some time now. Have fun gaming fellas.
from screepsautocomplete.
I just installed the NPM types, but if someone wants to generate up to date _references.js
and not the one from 2017, I made a small snippet for Linux.
Didn't get to test it however.
cd ScreepsAutocomplete
rm -f _references.js
for i in $(find ./ -iname \*.js | cut -c3-); do echo "/// <reference path=\"${i}\" />"; done > _references.js
from screepsautocomplete.
Hi @venom-code If you look through the Readme, there should be instructions on how to make this work with VisualStudio. Does this not work for you?
from screepsautocomplete.
I meen Visual Studio Code not Visual Studio :)
from screepsautocomplete.
Ah, gotcha. Is there a fair difference? Does the same process not work? What part of the process stops being the same for VSC? I'll look in to it, but if you can answer those upfront it may be quicker
from screepsautocomplete.
VS Code is quite similar to Atom both are build on electron (an Javascript framework). I think extension in Atom are written in Coffescript right ? In VS Code you write extesions in Javascript. Here is an link for extension developing.. and so on https://code.visualstudio.com/docs/extensions/overview I hope, i could help you.
I love this editor so much :) Hope you can get it !
from screepsautocomplete.
I'll look in to seeing if I can make some installation instructions for it
from screepsautocomplete.
Any progress on this?
from screepsautocomplete.
any update?
from screepsautocomplete.
Has there been any progress on this?
from screepsautocomplete.
Nice ty @MrFaul , would i have to add this to each file though or just the first?
from screepsautocomplete.
This needs to be documented elsewhere. For more visibility.
from screepsautocomplete.
Building on GWJYonder's findings, I played around with the various permutations of the above a bit.
Seems like the
/// <reference path=.......
line needed to only be in one file. But that file needed to be open in VScode for it to work. So you could put it in every file to be safe... or in one, e.g. main.js and ensure it's always open.
I ran the same tests without using this line at all, but including quonic's jsconfig.json file in the root project folder, and it seems to have the same effect, working even with no other windows open.
These weren't fully comprehenesive, just checking how many options I was presented with for a creep object, but seems like quonic's advice gets it all working.
from screepsautocomplete.
I was able to get autocompletion working using @QAutoBotOP's method in emacs!
I am using doom, rjsx-mode with lsp integration enabled. this might be off topic, but for anyone who stumbles on this I made a hook which automatically copies the ScreepsAutocomplete directory (with modifications) into the current project directory, if it is a screeps project:
(add-hook 'rjsx-mode-hook
(lambda ()
"sets up auto-complete for screeps projects.
Checks if rjsx-mode is being run in a screeps project. If so,
then copy over the autocomplete files to the current directory.
there is a potential problem, where, if there are multiple
subdirectories, the autocomplete files will be copied over
multiple times. this may or may not be an issue."
; check if we are in a screeps project
(if (and (string-match "Screeps/scripts"
(file-name-directory (buffer-file-name)))
(not (file-exists-p "ScreepsAutocomplete/")))
;; we are in a screeps directory without the autocomplete files
(copy-directory
"Absolute/path/to/Screeps/scripts/ScreepsAutocomplete/"
(file-name-directory (buffer-file-name))))))
from screepsautocomplete.
Related Issues (20)
- Creep.moveTo in WebStorm HOT 1
- Typo in Creep.getActiveBodyParts
- creep.moveTo function HOT 10
- creep.getActiveBodyparts
- Market object is not included HOT 1
- Visual Studio Integration HOT 9
- Add Game.market.getAllOrders()
- IntelliJ Universal 2016.2.5 - filter: (structure) is not resolving correctly HOT 2
- Visual Studio: Creep is not showing up as RoomObject
- New global constants
- [Feature Request] Notepad++ Support HOT 1
- Sublime Text 3, plugin refuses to work. HOT 1
- Sublime Text 3, SublimeCodeIntel Issue HOT 2
- Using with neovim HOT 5
- Help with Atom ScreepsAutocomplete HOT 2
- spawnCreep seems to not be working HOT 1
- Overload missing 'terrain' @ room
- Constants not working with autocomplete in webstorm HOT 3
- visual studio trouble
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from screepsautocomplete.