Skip to content

Commit

Permalink
0.2.0: Path conversion, OutputChannels, settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Corecii committed Nov 11, 2019
1 parent d4054e3 commit 152b5b7
Show file tree
Hide file tree
Showing 16 changed files with 697 additions and 62 deletions.
1 change: 1 addition & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ vsc-extension-quickstart.md
**/*.map
**/*.ts
roblox-plugin/**
roblox-test/**


*.afdesign
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ This extension can be found [on Visual Studio Marketplace](https://marketplace.v

This extension will log output from Roblox in VS Code for easier access.

This extension optionally converts Roblox paths to file paths so that you can click-to-go-to-source on errors.

## Requirements

You must install [this plugin](https://www.roblox.com/catalog/04158442719/redirect) ([Github](https://github.com/Corecii/Roblox-VS-Code-Output-Sync/releases)) in Roblox Studio to use this extension. Once installed, click the "Toggle" button at the beginning of each session to start logging the output to VS Code.
Expand All @@ -25,6 +27,14 @@ You must install [this plugin](https://www.roblox.com/catalog/04158442719/redire

## Release Notes

## 0.2.0

Output is now shown using OutputChannels (optional).

The plugin now converts Roblox script paths to file paths. When set to use OutputChannels, you can click on the path to go to the file.

Many settings added in relation with the new output conversion feature.

## 0.1.0

Output is now uploaded as chunks of characters instead of individual lines.
Expand Down
75 changes: 64 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

94 changes: 88 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,22 @@
"icon": "images/icon.png",
"homepage": "https://github.com/Corecii/Roblox-VS-Code-Output-Sync/blob/master/README.md",
"repository": {
"type" : "git",
"url" : "https://github.com/corecii/Roblox-VS-Code-Output-Sync.git"
"type": "git",
"url": "https://github.com/corecii/Roblox-VS-Code-Output-Sync.git"
},
"version": "0.1.0",
"version": "0.2.0",
"engines": {
"vscode": "^1.39.0"
},
"categories": [
"Other"
],
"keywords": [
"Roblox", "Lua"
"Roblox",
"Lua"
],
"activationEvents": [
"*",
"onCommand:extension.start",
"onCommand:extension.stop"
],
Expand All @@ -37,7 +39,84 @@
"title": "Stop Server",
"category": "Roblox Output"
}
]
],
"configuration": {
"title": "roblox-output-sync",
"properties": {
"robloxOutputSync.startServerPort": {
"type": "number",
"default": 32337,
"description": "The port to start the local log capture server on",
"minimum": 0,
"maximum": 65535
},
"robloxOutputSync.startAutomatically": {
"type": "boolean",
"default": false,
"description": "Whether to start automatically. It is suggested that you do not turn this on globally. Try turning it on per-workspace/project."
},
"robloxOutputSync.useOutputChannels": {
"type": "boolean",
"default": true,
"description": "Use output channels instead of pseudo-terminals. Output channels support clickable file links but do not support proper colors."
},
"robloxOutputSync.useColorizerLabels": {
"type": "boolean",
"default": true,
"markdownDescription": "Use [Output Colorizer](https://marketplace.visualstudio.com/items?itemName=IBM.output-colorizer)-compatible labels to colorize the output channel"
},
"robloxOutputSync.scriptPathAlwaysQuoted": {
"type": "boolean",
"default": true,
"description": "Whether to always quote file paths. If false, paths are only quoted if they contain a space."
},
"robloxOutputSync.scriptPathMini": {
"type": "boolean",
"default": false,
"markdownDescription": "Whether to replace \"mini\" script paths such as `ServerStorage.Modules.Module:1`"
},
"robloxOutputSync.scriptPathRelative": {
"type": "boolean",
"default": false,
"description": "Whether to use relative or absolute paths. Relative paths cannot be clicked but look nicer."
},
"robloxOutputSync.scriptPathMode": {
"type": "string",
"enum": [
"File",
"Roblox",
"File (Roblox)"
],
"default": "File",
"description": "How script paths are displayed",
"enumDescriptions": [
"Show only the file path",
"Show only the Roblox path",
"Show both in the format of file_path (roblox_path)"
]
},
"robloxOutputSync.scriptPathResolver": {
"type": "string",
"enum": [
"Rojo",
"Name",
"RojoName"
],
"default": "RojoName",
"description": "How Roblox script paths are resolved to file paths",
"enumDescriptions": [
"Use Rojo's default.project.json to find files",
"Use the script name to find files",
"Use Rojo to find files and use the script name as a backup"
]
},
"robloxOutputSync.watchFiles": {
"type": "boolean",
"default": true,
"markdownDescription": "If true, builds a script name to file path map internally by watching all Lua files in the workspace. For the Rojo resolver, this is used to resolve special file names such as `.server.lua` and is used to exclude files that do not exist on the file system. For the Name resolver, this is the entire backbone and is required for any resolution."
}
}
}
},
"scripts": {
"vscode:prepublish": "npm run compile",
Expand All @@ -57,7 +136,10 @@
"vscode-test": "^1.2.0"
},
"dependencies": {
"@types/fs-extra": "^8.0.1",
"ansi-regex": "^5.0.0",
"delay": "^4.3.0",
"express": "^4.17.1"
"express": "^4.17.1",
"fs-extra": "^8.1.0"
}
}
3 changes: 3 additions & 0 deletions roblox-test/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"robloxOutputSync.startAutomatically": true
}
43 changes: 43 additions & 0 deletions roblox-test/ros_test.project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "test",
"tree": {
"$className": "DataModel",
"HttpService": {
"$className": "HttpService",
"$properties": {
"HttpEnabled": true
}
},
"ReplicatedStorage": {
"$className": "ReplicatedStorage",
"Modules": {
"$path": "src/ReplicatedStorage"
}
},
"ServerStorage": {
"$className": "ServerStorage",
"Modules": {
"$path": "src/ServerStorage"
}
},
"ServerScriptService": {
"$className": "ServerScriptService",
"$path": "src/ServerScriptService"
},
"StarterPlayer": {
"$className": "StarterPlayer",
"StarterPlayerScripts": {
"$className": "StarterPlayerScripts",
"Source": {
"$path": "src/StarterPlayerScripts"
}
},
"StarterCharacterScripts": {
"$className": "StarterCharacterScripts",
"Source": {
"$path": "src/StarterCharacterScripts"
}
}
}
}
}
6 changes: 6 additions & 0 deletions roblox-test/src/ReplicatedStorage/ErrorModule.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

return {
Error = function(self, str)
error(str)
end
}
4 changes: 4 additions & 0 deletions roblox-test/src/ReplicatedStorage/InitModule/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

return function()
error('Error: from ModuleScript init.lua')
end
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
error('Error: from script init.server.lua')
2 changes: 2 additions & 0 deletions roblox-test/src/ServerScriptService/ModuleTest.server.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

require(game.ReplicatedStorage.Modules.ErrorModule):Error('Error: from ModuleScript')
1 change: 1 addition & 0 deletions roblox-test/src/ServerScriptService/ModuleTest2.server.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require(game.ReplicatedStorage.Modules.InitModule)()
8 changes: 8 additions & 0 deletions roblox-test/src/ServerScriptService/Subfolder/Test.server.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
local function doError()
print('\nTraceback (mini paths):')
print(debug.traceback())
print('')
error('Error: from ModuleScript in subfolder')
end

doError()
1 change: 1 addition & 0 deletions roblox-test/src/ServerScriptService/Test.server.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
error("Error: from root directory server script");
Loading

0 comments on commit 152b5b7

Please sign in to comment.