{"action":"created","issue":{"url":"https://api.github.com/repos/ionide/ionide-fsi/issues/6","labels_url":"https://api.github.com/repos/ionide/ionide-fsi/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/ionide/ionide-fsi/issues/6/comments","events_url":"https://api.github.com/repos/ionide/ionide-fsi/issues/6/events","html_url":"https://github.com/ionide/ionide-fsi/issues/6","id":107694829,"number":6,"title":"__SOURCE_DIRECTORY__ macro in subfolders","user":{"login":"alfonsogarciacaro","id":8275461,"avatar_url":"https://avatars.githubusercontent.com/u/8275461?v=3","gravatar_id":"","url":"https://api.github.com/users/alfonsogarciacaro","html_url":"https://github.com/alfonsogarciacaro","followers_url":"https://api.github.com/users/alfonsogarciacaro/followers","following_url":"https://api.github.com/users/alfonsogarciacaro/following{/other_user}","gists_url":"https://api.github.com/users/alfonsogarciacaro/gists{/gist_id}","starred_url":"https://api.github.com/users/alfonsogarciacaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alfonsogarciacaro/subscriptions","organizations_url":"https://api.github.com/users/alfonsogarciacaro/orgs","repos_url":"https://api.github.com/users/alfonsogarciacaro/repos","events_url":"https://api.github.com/users/alfonsogarciacaro/events{/privacy}","received_events_url":"https://api.github.com/users/alfonsogarciacaro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-22T11:20:11Z","updated_at":"2015-10-08T12:41:19Z","closed_at":null,"body":"If you have a F# script in a subfolder and use the `__SOURCE_DIRECTORY__` macro, this correctly points to the current directory in the editor (it works fine with the csv type provider for example). However, when you send it to the FSI, `__SOURCE_DIRECTORY__` becomes the root folder open by Atom. So, if you have a script in a subfolder with the following code:\r\n```\r\nopen FSharp.Data\r\nlet [<Literal>] tablePath = __SOURCE_DIRECTORY__ + \"/table.csv\"\r\ntype Stocks = CsvProvider<tablePath>\r\nlet fb = Stocks.Load(tablePath)\r\n```\r\nIt will fail in when sending it to FSI even if there're no errors in the editor."},"comment":{"url":"https://api.github.com/repos/ionide/ionide-fsi/issues/comments/146525992","html_url":"https://github.com/ionide/ionide-fsi/issues/6#issuecomment-146525992","issue_url":"https://api.github.com/repos/ionide/ionide-fsi/issues/6","id":146525992,"user":{"login":"Krzysztof-Cieslak","id":5427083,"avatar_url":"https://avatars.githubusercontent.com/u/5427083?v=3","gravatar_id":"","url":"https://api.github.com/users/Krzysztof-Cieslak","html_url":"https://github.com/Krzysztof-Cieslak","followers_url":"https://api.github.com/users/Krzysztof-Cieslak/followers","following_url":"https://api.github.com/users/Krzysztof-Cieslak/following{/other_user}","gists_url":"https://api.github.com/users/Krzysztof-Cieslak/gists{/gist_id}","starred_url":"https://api.github.com/users/Krzysztof-Cieslak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Krzysztof-Cieslak/subscriptions","organizations_url":"https://api.github.com/users/Krzysztof-Cieslak/orgs","repos_url":"https://api.github.com/users/Krzysztof-Cieslak/repos","events_url":"https://api.github.com/users/Krzysztof-Cieslak/events{/privacy}","received_events_url":"https://api.github.com/users/Krzysztof-Cieslak/received_events","type":"User","site_admin":false},"created_at":"2015-10-08T12:41:19Z","updated_at":"2015-10-08T12:41:19Z","body":"FSI.exe is run with opened root folder of Atom project as \"current working directory\" and this root directory is treated as  `__SOURCE_DIRECTORY__ `\r\n\r\nI really don't know  if there is any better solution - we can't change \"current working directory\" during running of session, and we can send to session code from different files (different locations) so starting it from root folder seems like a best way. "}}