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

get entrypoint file #6200

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Conversation

chunyu3
Copy link
Contributor

@chunyu3 chunyu3 commented Feb 28, 2025

Get the entrypoint file from a tsp project step by step as following:

  1. When tspMain defined in package.json, return the value of tspMain
  2. When there is main.tsp in the tsp project, return main.tsp
  3. if the selected is a tsp file, return it as entrypoint file

Apply above entrypoint strategy to traverse all entrypoint files in vscode worksapces.

@chunyu3 chunyu3 added the ide Issues for VS, VSCode, Monaco, etc. label Feb 28, 2025
@azure-sdk
Copy link
Collaborator

azure-sdk commented Feb 28, 2025

All changed packages have been documented.

  • typespec-vscode
Show changes

typespec-vscode - internal ✏️

Develop strategies to obtain the entry point file.

@azure-sdk
Copy link
Collaborator

azure-sdk commented Feb 28, 2025

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@chunyu3 chunyu3 force-pushed the TraverseEntrypointFile branch from 134de2b to e0065d9 Compare February 28, 2025 09:36
return entrypointTspFiles;
}

async function getEntrypointTspFileInFolder(folder: string): Promise<string | undefined> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you shouldn't rewrite that this is not the actual logic, you are missing exports which are a very complex resolution
We should share this logic from the compiler

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you document what gets resolved here?

Does it now only look for a pacakge.json first and then a main.tsp or it just look up for the first it finds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ide Issues for VS, VSCode, Monaco, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants