sn-edit / vscode Goto Github PK
View Code? Open in Web Editor NEWVIsual Studio Code Extension
Home Page: https://marketplace.visualstudio.com/items?itemName=SNEDIT.sn-edit
License: MIT License
VIsual Studio Code Extension
Home Page: https://marketplace.visualstudio.com/items?itemName=SNEDIT.sn-edit
License: MIT License
The config generation should be done in multiple steps.
core:
log_level: info
rate_limit: 2
db:
path: /path/to/db/file
initialised: false
rest:
masked: false
password: password
url: https://dev111.service-now.com
user: admin
xor_key: randomxorkey
root_directory: /path/to/scripts/folder/tmp
The scope is always added to the path of the files/entries. This means that if a file is open in the editor, we can determine the scope from the filepath.
Based on this we can call the command sn-edit updateset --list --scope scopename
, this will first request the data from the instance and then cache it in the database.
After subsequent calls, the data will be only returned from the database, which is quite instant. The update set name should be displayed in a notification bar or somewhere in the UI where appropiate.
If the currently opened file changes (someone switches to a new file), we should check if this new file is in a different scope, if yes, update the update set as described above by calling the command again.
While gathering information, please display some loading bar if technically possible in place of an empty update set name or something that would show the users that we are detecting the current update set.
Also add a command that would truncate the local cache.
Call it "Clear update set cache", this will be a seaparate command that would call sn-edit updateset --truncate
in the background and clear all update set data.
After calling this vscode command, please display a text field, where they could write update set names. After submission, call sn-edit updateset --list --scope scopename --json
which gets us a list of currently available update sets for that scope.
After the listing, display these to the user, so they can choose one update set to set as default. If they did choose one, run sn-edit updateset --set --scope scopename --update_set sysidofupdateset
, this will set the update set if run.
Display some notification to the user about success/failure.
We need to use something that can escape user input, implementing it ourselves will not be ideal, there can be a lot of edge-cases which we are not able to think about all of them.
We need a UI for the users in the vscode extension called with a command, that would allow them to search entries on the instance.
Some kind of autocomplete functionality must be workable I think from the extension. Needs some research.
A cli command will be needed too, that will return dataset in json format and this could be then feeded to the extension.
Flow:
sn-edit download
with the table and sys_id to download an entry more hereBlocking PR #12
We need at least two binaries to be existent on the target platform.
The second one sn-edit, has to be installed beforehand. Node should be present due to the nature of the vscode.
Check if workspacepath is existent and print out an error if not.
const workspacePath = vscode.workspace.workspaceFolders[0].uri.path;
This path specifically
Uploading an entry should be possible with a command but also with the option to listen on the "onsave" event of a file that is currently opened and has a valid path to tour workspace.
Two flows here:
Uploading with a command
* Run upload command
* The extension identifies sys_id and table from path and sys_id.txt file
* Calls the sn-edit upload --table tablename --sys_id sys_id
command which will upload the entry
* Display a notification about success/failure
One flow in this case
sn-edit upload --table tablename --sys_id sys_id
command which will upload the entryImplement a feature that would allow users to open the file they are currently editing on their instance.
Also find a suitable keyboard shortcut to make this more easily usable!
To avoid repetitive calls to determine the currently edited filename and also to have some generics lets make a core function that would be used throughout the app.
This would also allow us for more flexibility in the future if we would decide to change this at some point.
Functions that we need in core:
getFieldName
that would based on the vscode objects determine the current file)sys_id.txt
in our currently edited files folder, which should be present always but introduce some checks for this. The function should return the sys_id or some error if none found.On the right bottom side we will display the current update set based on the opened file that is currently open in the editor.
If there is no valid update set found, we will not display update set information (like for the config file which makes no apparent sense right?)
sn-edit updateset --set
flag to set this new update set as the session default more info hereA 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.