phrohdoh / oraide Goto Github PK
View Code? Open in Web Editor NEWA suite of tools to reduce friction in the development of OpenRA-based games
License: GNU Affero General Public License v3.0
A suite of tools to reduce friction in the development of OpenRA-based games
License: GNU Affero General Public License v3.0
components/oraide-miniyaml/src/arborist/tests.rs
components/oraide-miniyaml/src/lexer/tests.rs
components/oraide-miniyaml/src/parser/tests.rs
The tests in the above files should be reimplemented for the oraide-parser-miniyaml
component.
oraide-miniyaml
tests for oraide-parser-miniyaml
This component, oraide-miniyaml
, has been superseded by the oraide-parser-miniyaml
component and is not going to be used going forward so it should be deleted from the project.
Forcefully, recursively remove the component:
# in your terminal application, from the root of this project
$ rm -rf ./components/oraide-miniyaml/
For all remaining components, manually verify that they...
cargo test -p <component-name>
)cargo doc -p <component-name>
)Anything that is broken in one way or another should either...
The 'go-to-definition' feature of editors/IDEs takes users to the place (or places in some cases) where the symbol under their caret is defined (if any such definition is found).
This can be useful to OpenRA developers and game makers when they are, for example, creating unit B by copying unit A and making tweaks. They may want to quickly see the definition of a weapon so they can determine whether unit B should keep the current weapon or get a different one.
The query system needs to be able to handle the textDocument/definition
request which consists of an identifier for the source document and a position in said document (details here).
Add a GoToDefinition
struct variant containing fields with values derived from the TextDocumentPositionParams
type to QueryRequest
in the oraide-actor
component
Add a Definition
struct variant that contains a pos: Option<Position>
field to QueryResponse
in the oraide-actor
component
Add a TextDocDefinition
struct variant, similar to the existing TextDocDidOpen
variant, to LspMessage
in the oraide-language-server
component
Add a match arm in the lsp_serve
function of the oraide-language-server
component for LspMessage::TextDocDefinition
that sends a QueryRequest::GoToDefinition
instance
Add a match arm in the QuerySystem::process_message
function in the oraide-query-system
for the new QueryRequest::GoToDefinition
variant that queries the Database
(self.db
) for a definition given a Position
in a file (see the existing hover_with_file_name
usage for reference)
Add a function named definition_with_file_name
to the trait LangServerCtx
in the oraide-query-system
component with the signature fn definition_with_file_name(&self, file_name: String, pos: Position) -> Option<Position>
and be sure to include a salsa::invoke
attribute (again see hover_with_file_name
for reference) and inline documentation
Implement definition_with_file_name
in components/oraide-query-system/src/query_definitions.rs
FileId
from the Database
given the file's name (which is a URL in practice)Position
Back in the QuerySystem::process_message
function's QueryRequest::GoToDefinition
match arm's body send a QueryResponse::Definition
instance to self.send_channel
Find the Actor
impl for LspResponder
in the oraide-language-server
component (components/oraide-language-server/src/lib.rs
) and add a match arm to the on_new_messages
function's body for QueryResponse::Definition
which will convert the Definition
into an Option<languageserver_types::Location>
and invoke send_response
with the newly-created Option<languageserver_types::Location>
Test it!
OpenRA.Game/Traits/LintAttributes.cs
in the engine's source tree)
I do not know why it is an object.
This is causing an exception to be thrown on Windows (but I don't see this on macOS).
Need to consult a software license lawyer to determine if this can be done and if so which to choose.
The Lark project, which heavily influences the design of oraide
, has a struct named Text
that is essentially a slice of a String
.
Lark uses this type to avoid expensive clones of String
s in and out of the salsa
database which we currently do a lot of.
Implementing and using Text
will theoretically improve performance of oraide
but we have no numbers to support this claim currently.
I'm not sure yet in which component to put this Text
type (or if a new component should be created).
oraide-sdk
appears to be the only user of oraide-miniyaml
(which we want to get rid of any way, see #2). Instead oraide-parser-miniyaml
should be used.
Remove src/main.rs
from oraide-sdk
.
It exists only as a playground for oraide-sdk
's types and we don't need it any more.
Starting with Visual Studio 2017 version 15.8, support for the common Language Server Protocol is built into Visual Studio.
Please give this issue a 👍reaction if you are interested in using oraide
via VS.
I'm not yet sure exactly where to document general oraide
features vs features of the VSCode extension or if that distinction should be made at all at this point.
Ensure that we retain all correct information in the docs/dev/architecture.md
file.
When VSCode is closed the server process should be stopped with the code written as it is now but this is not the case for reasons currently unknown.
This means the server process stays around holding things in memory that we no longer need.
The user may end up with multiple ora
instances running in IDE mode eating up memory which is obviously not good.
You can use ps
to find the process's PID (process ID) which in turn be used with kill
to end the process.
$ ps aux | { head -1; grep ora }
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
taryn 28800 0.0 0.0 4272648 1136 ?? S 6:32AM 0:00.01 bash /Users/taryn/src/tools/oraide/components/oraide-language-server/tools/interceptor.bash ide
taryn 28809 0.0 0.0 4278196 720 ?? S 6:32AM 0:00.00 tee /tmp/ora.in.log
taryn 28810 0.0 0.0 4330876 8228 ?? S 6:32AM 0:00.02 /Users/taryn/src/tools/oraide/target/debug/ora ide
taryn 28811 0.0 0.0 4277172 700 ?? S 6:32AM 0:00.00 tee /tmp/ora.out.log
$ kill -9 28810
You can use the Get-Process
and Stop-Process
PowerShell commands to find and end the process.
PS /Users/taryn> Get-Process "ora"
NPM(K) PM(M) WS(M) CPU(s) Id SI ProcessName
------ ----- ----- ------ -- -- -----------
0 0.00 5.79 0.87 36453 …20 ora
PS /Users/taryn> Stop-Process -Id 36453
We should probably simplify extension.ts
to be similar to Lark's.
[content removed due to project changes]
In the file editors/vscode/docs/user/README.md
oraide.server.exeArgs
should be documented similar to how oraide.server.exePath
is documented.
For reasons currently unknown to me the VSCode extension does not actually stop the server process when the VSCode instance is closed so the server stays around which means memory is being taken up with absolutely no gain for the end user.
Document this fact somewhere in the VSCode-specific docs and how the process can be stopped manually should once choose to do so.
The how is:
$ ps aux | grep ora
kill
it:# example pid: 12345
$ kill -9 12345
Currently we load documents into the database only when the document is opened (more concretely: when the server gets a textDocument/didOpen
notification).
This work will have us updating the database when a document is changed via the client (if a document is changed in a different editor we won't know about that).
This will allow us to perform actions (such as responding to queries, ex: "find all references") based off of text that has not yet been written to disk.
That isn't the entire truth as we do not yet update the database when we get a textDocument/didSave
notification, but hopefully you get the idea.
Once both textDocument/didChange
and textDocument/didSave
are implemented and update the relevant documents in the database in-place then we will have the absolute basic machinery to support basic features that users can logically expect from an IDE.
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.