Skip to content

Commit

Permalink
Register signature provider
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnnyMorganz committed Jun 27, 2020
1 parent b6fcff0 commit 5d4a9fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 57 deletions.
3 changes: 3 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { ItemStructCompletionProvider } from "./itemStruct"
import { LuaLibraryCompletionProvider } from "./luaLibrary"
import { RojoHandler } from "./rojo"
import { ServiceCompletionProvider } from "./services"
import { RobloxSignatureProvider } from "./signatureProvider"
import { inferType } from "./utils"
const SELECTOR = { scheme: "file", language: "lua" }

export async function activate(context: vscode.ExtensionContext) {
Expand Down Expand Up @@ -43,4 +45,5 @@ export async function activate(context: vscode.ExtensionContext) {
context.subscriptions.push(vscode.languages.registerCompletionItemProvider(SELECTOR, new ServiceCompletionProvider(), ".", ":"))
context.subscriptions.push(vscode.languages.registerCompletionItemProvider(SELECTOR, new LuaLibraryCompletionProvider(), "."))
context.subscriptions.push(vscode.languages.registerCompletionItemProvider(SELECTOR, new ItemStructCompletionProvider(), "."))
context.subscriptions.push(vscode.languages.registerSignatureHelpProvider(SELECTOR, new RobloxSignatureProvider(), "(", ","))
}
57 changes: 0 additions & 57 deletions src/signatureProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,63 +131,6 @@ export class RobloxSignatureProvider implements vscode.SignatureHelpProvider {

return [ functionHelpers ]
})()

// this.serviceFunctionHelpers = (async () => {
// const output = new Map()

// const services = (await getServices).values()
// for (const service of services) {
// const callableMembers = service.Members.filter(
// member => member.MemberType === "Function") as ApiFunction[]

// const classInformations: ClassSignatureInformations = {}

// for (const member of callableMembers) {
// classInformations[member.Name] = classInformations[member.Name] || []

// const signature = parameterizeSignature(
// new vscode.SignatureInformation(`${member.Name}(`),
// member.Parameters,
// )

// signature.label += `): ${member.ReturnType ? member.ReturnType.Name : "unknown"}`
// signature.documentation = createDocumentationString(member, "function", service.Name)
// classInformations[member.Name].push(signature)
// }

// output.set(service.Name, classInformations)
// }

// return output
// })()

// this.serviceEventHelpers = (async () => {
// const output = new Map()

// const services = (await getServices).values()
// for (const service of services) {
// const callableMembers = service.Members.filter(
// member => member.MemberType === "Event") as ApiFunction[]

// const classInformations: ClassSignatureInformations = {}

// for (const member of callableMembers) {
// classInformations[member.Name] = classInformations[member.Name] || []

// const signature = parameterizeSignature(
// new vscode.SignatureInformation(`${member.Name}:Connect(`),
// member.Parameters,
// )
// signature.label += ")"
// signature.documentation = createDocumentationString(member, "event", service.Name)
// classInformations[member.Name].push(signature)
// }

// output.set(service.Name, classInformations)
// }

// return output
// })()
}

public async provideSignatureHelp(
Expand Down

0 comments on commit 5d4a9fd

Please sign in to comment.