summaryrefslogtreecommitdiff
blob: 641f7710167a1b8177e9faf25d1a1e5c2b5f52b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
--- rstudio-1.1.453-orig/src/cpp/session/SessionClientInit.cpp	2018-05-15 04:19:30.000000000 +1000
+++ rstudio-1.1.453/src/cpp/session/SessionClientInit.cpp	2018-07-02 20:21:41.595654877 +1000
@@ -105,7 +105,7 @@
    }
 
    // prepare session info 
-   json::Object sessionInfo ;
+   core::json::Object sessionInfo ;
    sessionInfo["clientId"] = clientId;
    sessionInfo["mode"] = options.programMode();
    
@@ -119,8 +119,8 @@
    }
 
    // temp dir
-   FilePath tempDir = rstudio::r::session::utils::tempDir();
-   Error error = tempDir.ensureDirectory();
+   core::FilePath tempDir = rstudio::r::session::utils::tempDir();
+   core::Error error = tempDir.ensureDirectory();
    if (error)
       LOG_ERROR(error);
    sessionInfo["temp_dir"] = tempDir.absolutePath();
@@ -132,12 +132,12 @@
    sessionInfo["prompt"] = rstudio::r::options::getOption<std::string>("prompt");
 
    // client state
-   json::Object clientStateObject;
+   core::json::Object clientStateObject;
    rstudio::r::session::clientState().currentState(&clientStateObject);
    sessionInfo["client_state"] = clientStateObject;
    
    // source documents
-   json::Array jsonDocs;
+   core::json::Array jsonDocs;
    error = modules::source::clientInitDocuments(&jsonDocs);
    if (error)
       LOG_ERROR(error);
@@ -159,7 +159,7 @@
    if (resumed)
    {
       // console actions
-      json::Object actionsObject;
+     core::json::Object actionsObject;
       consoleActions.asJson(&actionsObject);
       sessionInfo["console_actions"] = actionsObject;
    }
@@ -211,12 +211,12 @@
    }
    else
    {
-      sessionInfo["active_project_file"] = json::Value();
-      sessionInfo["project_ui_prefs"] = json::Value();
-      sessionInfo["project_open_docs"] = json::Value();
+      sessionInfo["active_project_file"] = core::json::Value();
+      sessionInfo["project_ui_prefs"] = core::json::Value();
+      sessionInfo["project_open_docs"] = core::json::Value();
       sessionInfo["project_supports_sharing"] = false;
       sessionInfo["project_owned_by_user"] = false;
-      sessionInfo["project_user_data_directory"] = json::Value();
+      sessionInfo["project_user_data_directory"] = core::json::Value();
    }
 
    sessionInfo["system_encoding"] = std::string(::locale2charset(NULL));
@@ -253,20 +253,20 @@
       sessionInfo["build_tools_bookdown_website"] =
                               module_context::isBookdownWebsite();
 
-      FilePath buildTargetDir = projects::projectContext().buildTargetPath();
+      core::FilePath buildTargetDir = projects::projectContext().buildTargetPath();
       if (!buildTargetDir.empty())
       {
          sessionInfo["build_target_dir"] = module_context::createAliasedPath(
                                                                 buildTargetDir);
-         sessionInfo["has_pkg_src"] = (type == r_util::kBuildTypePackage) &&
+         sessionInfo["has_pkg_src"] = (type == core::r_util::kBuildTypePackage) &&
                                       buildTargetDir.childPath("src").exists();
          sessionInfo["has_pkg_vig"] =
-               (type == r_util::kBuildTypePackage) &&
+               (type == core::r_util::kBuildTypePackage) &&
                buildTargetDir.childPath("vignettes").exists();
       }
       else
       {
-         sessionInfo["build_target_dir"] = json::Value();
+         sessionInfo["build_target_dir"] = core::json::Value();
          sessionInfo["has_pkg_src"] = false;
          sessionInfo["has_pkg_vig"] = false;
       }
@@ -274,9 +274,9 @@
    }
    else
    {
-      sessionInfo["build_tools_type"] = r_util::kBuildTypeNone;
+      sessionInfo["build_tools_type"] = core::r_util::kBuildTypeNone;
       sessionInfo["build_tools_bookdown_website"] = false;
-      sessionInfo["build_target_dir"] = json::Value();
+      sessionInfo["build_target_dir"] = core::json::Value();
       sessionInfo["has_pkg_src"] = false;
       sessionInfo["has_pkg_vig"] = false;
    }
@@ -285,7 +285,7 @@
    sessionInfo["presentation_commands"] = options.allowPresentationCommands();
 
    sessionInfo["tutorial_api_available"] = false;
-   sessionInfo["tutorial_api_client_origin"] = json::Value();
+   sessionInfo["tutorial_api_client_origin"] = core::json::Value();
 
    sessionInfo["build_state"] = modules::build::buildStateAsJson();
    sessionInfo["devtools_installed"] = module_context::isMinimumDevtoolsInstalled();
@@ -296,7 +296,7 @@
 
    // console history -- we do this at the end because
    // restoreBuildRestartContext may have reset it
-   json::Array historyArray;
+   core::json::Array historyArray;
    rstudio::r::session::consoleHistory().asJson(&historyArray);
    sessionInfo["console_history"] = historyArray;
    sessionInfo["console_history_capacity"] =
@@ -364,13 +364,13 @@
 
    sessionInfo["multi_session"] = options.multiSession();
 
-   json::Object rVersionsJson;
+   core::json::Object rVersionsJson;
    rVersionsJson["r_version"] = module_context::rVersion();
    rVersionsJson["r_home_dir"] = module_context::rHomeDir();
    sessionInfo["r_versions_info"] = rVersionsJson;
 
    sessionInfo["show_user_home_page"] = options.showUserHomePage();
-   sessionInfo["user_home_page_url"] = json::Value();
+   sessionInfo["user_home_page_url"] = core::json::Value();
    
    sessionInfo["r_addins"] = modules::r_addins::addinRegistryAsJson();
    sessionInfo["package_provided_extensions"] = modules::ppe::indexer().getPayload();
@@ -394,7 +394,7 @@
 
    // send response  (we always set kEventsPending to false so that the client
    // won't poll for events until it is ready)
-   json::JsonRpcResponse jsonRpcResponse ;
+   core::json::JsonRpcResponse jsonRpcResponse ;
    jsonRpcResponse.setField(kEventsPending, "false");
    jsonRpcResponse.setResult(sessionInfo) ;
    ptrConnection->sendJsonRpcResponse(jsonRpcResponse);