Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ FunC support includes:
- Inlay hints for method id
- On-the-fly inspections
- Build and test projects based on Blueprint
- Debug Blueprint-based projects

Fift assembly support includes:

Expand Down Expand Up @@ -276,6 +277,11 @@ Setup steps:

See [TROUBLESHOOTING.md](./docs/manual/troubleshooting.md).

# License
## Thanks

- Big thanks to [TonTech](https://ton.tech) for [FunC debugger
implementation](https://github.com/krigga/tvm-debugger)!

## License

MIT
1 change: 1 addition & 0 deletions editors/code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ FunC support includes:
- Inlay hints for method id
- On-the-fly inspections
- Build and test projects based on Blueprint
- Debug Blueprint-based projects

Fift assembly support includes:

Expand Down
30 changes: 30 additions & 0 deletions editors/code/src/debugging/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import * as vscode from "vscode"
import {DebugAdapterExecutable, DebugSession} from "vscode"

export function configureDebugging(context: vscode.ExtensionContext): void {
context.subscriptions.push(
vscode.debug.registerDebugConfigurationProvider("tvm", {
provideDebugConfigurations() {
return [
{
type: "tvm",
name: "Debug",
request: "launch",
},
]
},
}),
vscode.debug.registerDebugAdapterDescriptorFactory("tvm", {
createDebugAdapterDescriptor(_s: DebugSession, _e: DebugAdapterExecutable | undefined) {
return new vscode.DebugAdapterServer(42_069)
},
}),
vscode.commands.registerCommand("ton.debug", () => {
void vscode.debug.startDebugging(undefined, {
type: "tvm",
name: "Debug",
request: "launch",
})
}),
)
}
3 changes: 3 additions & 0 deletions editors/code/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {BocDecompilerProvider} from "./providers/BocDecompilerProvider"
import {registerSaveBocDecompiledCommand} from "./commands/saveBocDecompiledCommand"
import {Range, Position, FileSystemWatcher} from "vscode"
import {ToolchainConfig} from "@server/settings/settings"
import {configureDebugging} from "./debugging"

let client: LanguageClient | null = null
let cachedToolchainInfo: SetToolchainVersionParams | null = null
Expand All @@ -40,6 +41,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
await registerBuildTasks(context)
registerOpenBocCommand(context)
registerSaveBocDecompiledCommand(context)
configureDebugging(context)

const config = vscode.workspace.getConfiguration("ton")
const openDecompiled = config.get<boolean>("boc.openDecompiledOnOpen")
Expand Down Expand Up @@ -664,6 +666,7 @@ async function checkConflictingExtensions(): Promise<void> {
const conflictingExtensions = [
{id: "tonwhales.func-vscode", name: "FunC"},
{id: "ton-core.tolk-vscode", name: "Tolk"},
{id: "krigga.tvm-debugger", name: "TVM Debugger"},
]

const installedConflicting = conflictingExtensions.filter(ext => {
Expand Down
15 changes: 15 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,17 @@
}
],
"snippets": [],
"debuggers": [
{
"type": "tvm",
"label": "TVM Debug"
}
],
"breakpoints": [
{
"language": "func"
}
],
"commands": [
{
"command": "tolk.build",
Expand Down Expand Up @@ -266,6 +277,10 @@
{
"command": "tolk.getUnresolvedIdentifiers",
"title": "Tolk: Get Unresolved Identifiers"
},
{
"command": "ton.debug",
"title": "TON: Debug contract"
}
],
"keybindings": [
Expand Down
Loading