Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

did not find primary SourceFile #662

Open
iMostfa opened this issue Aug 4, 2020 · 4 comments
Open

did not find primary SourceFile #662

iMostfa opened this issue Aug 4, 2020 · 4 comments

Comments

@iMostfa
Copy link

iMostfa commented Aug 4, 2020

i have a problem when making a request using the framework:
here's my code:
`

let file = File(path: "/Users/username/Downloads/file.swift")!
let request  = SourceKittenFramework.Request.cursorInfo(file: "/Users/mostfa/Downloads/file.swift", offset: (90), arguments: [file.path!])
let cursorInfo = try  request.send()

print(cursorInfo)

`

and the response i get is
{"error":true,"reason":"did not find primary SourceFile"}

i tried to google it, but didn't find an answer :(

file path is correct, and the structure for same file is generated as expected,
can anyone help me with this ? thank you very much

@kristiinara
Copy link

Have you found a solution? I'm running into the same problem after an XCode update.

@iMostfa
Copy link
Author

iMostfa commented Nov 6, 2020

Have you found a solution? I'm running into the same problem after an XCode update.

Unfortunately, no

@johnfairh
Copy link
Collaborator

SourceKit has required an explicit SDK for CursorInfo for a few Swift releases now.

So you need to include "-sdk", "/path/to/sdk" in the args.

Yes, the error response from SourceKit is misleading.

@kristiinara
Copy link

I had the same problem with the index request, but have both sdk and target specified. Could there be some additional argument that needs to be specified?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants